Ways to bypass CORRECT_Z_ORDER?

Software: Away3D 3.x

Toidas, Newbie
Posted: 22 July 2011 06:23 AM   Total Posts: 5

To my knowledge, there are 3 options regarding Z order. The first option - the BASIC renderer - messes up the scene (as is usual). With CORRECT_Z_ORDER everything works fine, but the frame rate is too low - maybe less than 1 fps. Setting ownCanvas = true for each object and sticking to the BASIC renderer helps, but the plane, which should be below the models, sometimes hides them. Hence, not a single option I know works for me. Maybe there are other ways to bypass CORRECT_Z_ORDER, which is too computationally intensive?  (I am using Away3D 3.6)
A little note: the user can’t access any point of view from which the plane should hide the models. Therefore, a possible solution might be to set the models to be always rendered after the plane and to always be “on top” of it. The problem is that I don’t know how to achieve this and even if this is possible.

   

Stephen Hopkins, Sr. Member
Posted: 22 July 2011 07:05 AM   Total Posts: 110   [ # 1 ]

You can use multiple views stacked on top of each other, one for the background/plane, one for the objects.

Might be able to fix the plane problem by adding segmentsW and segmentsH to it, try to make the triangles on it roughly the same size as your objects.

 Signature 

http://www-scf.usc.edu/~shopkins

   

Toidas, Newbie
Posted: 22 July 2011 07:54 AM   Total Posts: 5   [ # 2 ]

Well, I’ve found another solution and I’ll post it here for others to use.
It seems that the BASIC renderer renders objects according to their position in the scene graph. Hence the order of objects matters. If you want something to be rendered first, you should add it to the scene graph first, etc.
Changing the positions of the lines view.scene.addChild( X ) solved the problem.

   

Stephen Hopkins, Sr. Member
Posted: 22 July 2011 09:51 PM   Total Posts: 110   [ # 3 ]

I think Renderer.BASIC used the painter’s algorithm. http://en.wikipedia.org/wiki/Painter’s_algorithm

The order you add the objects shouldn’t matter, but if that works for you, all good.

 Signature 

http://www-scf.usc.edu/~shopkins

   

Toidas, Newbie
Posted: 26 July 2011 07:44 AM   Total Posts: 5   [ # 4 ]

You were right. Changing the order of the objects in the scene graph helped, but only for a while. Now I’ve added more objects and I’m in trouble again. I don’t really now what to do, so maybe someone has some suggestions regarding or experience of a similar problem?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X