Original Post
Hi All, I am in a conundrum about my scene graph. At the moment I have a root class node (which can have child nodes), with derived classes sceneobject, light and geometry, and then derived from geometry I have trimesh and linelist. A model (person, etc.) is of type sceneobject and has child meshes (more than one mesh can make up a model). Works good, but if I want to use the same model twice in the scene then the trimesh has two sceneobject parents (I had to remove the parent property because of this). I understand this is called a DAG. This leaves me with the problem of being unable to walk 'up' the tree, and also means that the WorldTransform (that is part of the node base class) cannot be different for each instance of the geometry (individual geometry objects are fed into the render queue to be sorted by material, etc.) I can see two alternatives. First, instead of sharing the geometry object, then take a copy of it. This doesn't seem very elegant though, but technically could still share the resources as the underlying vertices lists etc. are pointers to lists in the class. Second alternative is to not have the geometry class derived from node, and have it not able to have children. Then I could just have a linked list of meshes for the sceneobject structure and if I need to do a hierarchical mesh then I could attach another node and then a geometry object to that. This way the scene graph would be a true tree. Not sure what I would do about the WorldTransform here though. Can anyone give me pointers as to the best approach? Thanks! [Edited by - Raeldor on September 15, 2005 1:42:29 PM]
