Scene Transform Hiearchies

Started by
0 comments, last by Ender1618 14 years, 5 months ago
Ok so I am once again overhauling my engine for a new DX11 implementation, and I have revisited the age old question of scene level transform hierarchies. I am debating between 3 different methodologies: *Note for each of these methods, any type of bone hierarchies are maintained within the Model class, with allowed attachment points for any FrameRef to any bone. This supports skinned mesh bones and things like wheels on cars. Method 1: The class FrameRef contains a simple local position and orientation, and a list of children FrameRefs. Classes Camera, Light, and Model derive from FrameRef. A complex hierarchy can be formed with a tree of any of these derived classes as well as instances of non-derived from FrameRefs themselves. For example you could have a Model attached to a FrameRef which is attached to a Camera. Pros: - Very simple design Cons: - There are now 2 very different types of things in the scene graph - Takes extra FrameRefs to introduce an offset (e.g. you want your character facing -z not +z by default) Method 2: The class FrameRef contains a local position and orientation as well as an offset position and orientation. Classes Camera, Light, and Model derive from SceneNode which derives from FrameRef. This is similar to how 3DSMax does its hierarchies, giving one the capability to change the pivot point of an object. To accomplish this with method 1 you would need to use an extra FrameRef. A complex hierarchy can be formed with a tree of SceneNodes. For example you could have a car model that when imported has its pivot 1 meter off the ground (say at the 3D center of the cars bounding box), you could use the offset to push the pivot down to bottom of the wheels. Pros: - Encompasses offset transforms nicely - There is only really one type of object in the scene graph, a SceneNode Cons: - Added complexity in FrameRef Method 3: The class FrameRef contains a simple local position and orientation, a pointer to an optional scene object (such as a camera, light, or model), and a list of children FrameRefs. This is similar to how Ogre does it's hierarchies. Pros: -Ogre does it ? Cons: -Can no longer just add a camera to a scene, need at least a FrameRef and a Camera to accomplish this Any insight would be appreciated. Thanx [Edited by - Ender1618 on November 4, 2009 12:37:29 PM]
Advertisement
Would anyone know how Gamebryo handles this?

This topic is closed to new replies.

Advertisement