Original Post
ok, this is more philosofical than anything else.
basically, the scenegraph should keep a hierarchy of objects within a scene, when one node is attached to another, then it inherits all/some of its properties (translation, rotation, etc)... however I came into a dillema while implementing a scene graph for my graphics engine:
should each node in the scene graph keep track of its current position? (making the graphics engine user just update how much will it translate from its current position) like this:
making MyNode to move on steps of 10 units each loop.
Or should the user keep track of each object's position and just update on what position should the object be placed, like this:
what do you think would be more appropriate?
basically, the scenegraph should keep a hierarchy of objects within a scene, when one node is attached to another, then it inherits all/some of its properties (translation, rotation, etc)... however I came into a dillema while implementing a scene graph for my graphics engine:
should each node in the scene graph keep track of its current position? (making the graphics engine user just update how much will it translate from its current position) like this:
MyNode->translate( 10, 0, 0 ); // located at <10,0,0>
// next frame
MyNode->translate( 10, 0, 0 ); // located at <20,0,0>
// next frame
MyNode->translate( 10, 0, 0 ); // located at <30,0,0>
making MyNode to move on steps of 10 units each loop.
Or should the user keep track of each object's position and just update on what position should the object be placed, like this:
MyNode->translate( 10, 0, 0 ); // located at <10,0,0>
// next frame
MyNode->translate( 20, 0, 0 ); // located at <20,0,0>
// next frame
MyNode->translate( 30, 0, 0 ); // located at <30,0,0>
what do you think would be more appropriate?