Concept of Java3D's OrderedGroup...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Concept of Java3D's OrderedGroup...

ThomasR
Are we guaranteed that children will be rendered in the order added to a Node? If not, is there a way to force this, or will I need an extension somewhat similar to SwithNode -> Node?
Reply | Threaded
Open this post in threaded view
|

Re: Concept of Java3D's OrderedGroup...

gouessej
Administrator
Hi

Maybe I'm missing something but I do nothing to drive it more complicated than it has to be. The children are stored into plain array lists, I use nothing fancy. However, note that they are drawn in the reverse order except if you use a delegate.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Concept of Java3D's OrderedGroup...

ThomasR
Okay, thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Concept of Java3D's OrderedGroup...

ThomasR
In reply to this post by gouessej
Is there an example of use of a Delegate for indirection of render order?
Reply | Threaded
Open this post in threaded view
|

Re: Concept of Java3D's OrderedGroup...

gouessej
Administrator
No there isn't but you just have to implement a single method: void render(Spatial spatial, Renderer renderer). You should only use almost the same code than Node.draw() (except the order in the loop) when the spatial is a node and call Spatial.onDraw() when the spatial isn't a node.
Julien Gouesse | Personal blog | Website