Hello, thank you very much for the answer. I just thought that a node would be erased if it wasn't linked to the graph but it was stupid. So i created a parent node under which i have my models but this node is not linked to the root node as it was before (i think you meant that when you advised me to use 2 graphs). Like that, my models are supposed to survive because they are referenced by their parent (which i called "modelesNode", because i'm french). I also think it's important to call addRefCP onto modelesNode because it's not referenced by any parent. But i have a problem now : when I initialize my instances, i'm reading a file and each time I find an object (in a "for" loop), I traverse the models' graph in order to know whether the model of this object has already been created and put inside the models' graph or not. If not, i'm loading the model and i put it under my "modelesNode". If yes, I just get the node of the model. And then I tell the object (the instance) that its child is this model, etc. And then my loop re-begins. But at the beginning of this loop, when i check what's under my "modelesNode", there is nothing ! So what happens? Why the models' graph is empty whereas it wasn't just the loop before? Any ideas?
Thank you very much.

Jo



Hi,

Jo Bard wrote:
                Hello everyone,

I work on a project where we can have many instances of the same object. So I chose to load my models in a branch of the graph (which won't be drawable) and to put my instances of theses models in another branch, a drawable one.

why not just use two graphs? The one with the models would have a Node with a Group core and Nodes with Geometry cores (your models) as children. The graph with instances would then contain a bunch of nodes with Transform cores and the leaf Nodes would simply use the Geometry cores from the other graph. Strictly speaking you would not even need the graph with the models, but it is probably the easiest way to keep them alive even if a model is not referenced by your "instances" graph.
Finally only pass the "instances" graph to the RenderAction to get an image.
If some/all of this sounds strange to you, please check out the docs Andreas pointed you to.

In fact my instances are just some transformation nodes which have the model's node as a child. So I would like to render only the objects of the drawable branch of the graph. How can I do it ?

If you insist on using branches of the same graph, you can check out the
documentation on get/setTravMask methods of the Node class.

I would also like to know if a geometry node is rendered if it has no "transformation" parent.

The RenderAction draws the graph that lives below the root it is given and that could be as simple as a Node with a Geometry core or (nearly) as complicated as you like ;)


Regards,
Carsten


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

_________________________________________________________________
MSN Messenger : dialoguez en temps réel avec vos amis ! http://g.msn.fr/FR1001/866



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to