Page 1 of 1

Depth Sorting Problem

Posted: Tue May 20, 2008 4:36 pm
by Matt2fronteeth
I've assembled this four-sided box, but when I orbit around it the yellow side always covers the blue side. I have depth sorting turned on in the group, and there is never a problem between the red and green sides no matter from which angle I view the box. Changing the order of the blue and yellow sides within the group only changes which side (blue or yellow) overrides the other. Why is this happening?

Oddly enough, I've done the 3D construction tutorial, lesson 2.8, and this problem does not occur there.

Image[/img]

Posted: Tue May 20, 2008 5:00 pm
by Genete
Sort operations for layers are based on Origin Z depth from camera point of view. In this case the yellow side of the box is closer (in terms of calculated Z depth based on its Origins) to the camera than the cyan one. It is caused by the origin position of the yellow reactangle is closer to the camera than the cyan one. To avoid that problem you have to place each object centered around the origin. Then the posibility of mistakes are lower depending on the shape of each side and the point of view of your camera.

If you cannot solve by your self please post the file.

-G

Posted: Tue May 20, 2008 6:51 pm
by Matt2fronteeth
Thank you very much. Centering the initial rectangle on the "origin" is what I had neglected to do. I remade the box with this in mind and it worked perfectly. I'm still a little foggy on what the various values relate to, though. When you place such figures as "-.06" or "+1.5" in the translate layer panel, what are those values based on? The answer is probably staring me right in the face, but I haven't grasped it yet.

Also, does the number of squares in your grid have anything to do with the resulting size of shapes you draw on it?

The relationships of the origin and these numbers is what still baffles me. I was able to build my box with ones and point fives, but don't really know why. With me, at this point, it's just guess work.

Again, thanks for your help.

Posted: Tue May 20, 2008 8:43 pm
by heyvern
Matt2fronteeth wrote:I'm still a little foggy on what the various values relate to, though. When you place such figures as "-.06" or "+1.5" in the translate layer panel, what are those values based on?
They are not "based" on anything really. It is a "unit of measurement" within AS.

The width and height of the project is based on the pixel dimensions you set in the project settings. The height is always the same value... 0 at the center 1 at the top, -1 at the bottom.

The width changes based on the ratio of the width/height. So the height is always 1 to -1 but the width might be 1.3 or 1.6 or 2 depending on the rectangular ratio. (the blue box that is the render area of course. You can have an object that is set to 5.6 on the Y axis... this would out way off the top out of view probably.)

So... a value like .06 represents .06 of the "1" from the top to the center of the project size. I'm pretty sure about this, that is how it works for X and Y axes... but I don't know for sure about the Z-axis.

-vern