1
\$\begingroup\$

I'm trying to wrap my head around how scene graphs work, and how to apply that to my game, in the context of all my game objects, including assets, cameras, units, shaders, etc.

All I can find are massively simplified examples that include planets and rotations. What I'd like is a real world example of a well written scene graph, preferably in C++ and if possible with some form of graphical representation of at least a part of the graph.

Additional information: I am writing a real time strategy game using C++ and DirectX 11. Any other pointers for advice would be massively helpful. Wrapping my head around a scene graph and how that would relate to design patterns like data locality etc, and how to encapsulate it all in a standardised system is proving very difficult for me. I am extremely, extremely confused.

\$\endgroup\$
  • \$\begingroup\$ Did you inspect open source scene graphcs like Ogre3d or OpenSceneGraph? \$\endgroup\$ – Vaillancourt Nov 12 '15 at 19:57
  • \$\begingroup\$ The truth is I wouldn't even know where to begin! \$\endgroup\$ – Mark Nov 12 '15 at 22:42
  • \$\begingroup\$ The most clear example is a component-entity framework that many game engines use. The hierarchy of entities is the structure of the underlying scene graph. \$\endgroup\$ – ratchet freak Nov 13 '15 at 9:45
-1
\$\begingroup\$

With a scene graph you can have child objects that move when parent moves. You can also make some states propagate to children, like hiding/showing groups of objects just by changing the state of the root of the hierarchy. Implementation could be done by game objects having a transform component that has a pointer to its parent.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.