1
\$\begingroup\$

This is a general question which aim is to allow me to start digging on the subject by myself.

As I noticed the general opinion is that scene graphs are good for describing the scene in a level editor (or any editor that the game is using), but the game itself should use some sort of optimized data structure internally and the scene graphs should be somehow "translated" to that data structure before use.

What such internal data structures would be? How one would "translate" a scene graph to such structures.

In general - the more detail you can give me then better. Also references/links are more than welcome. :)

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

So talking about this internal data structure, this can be a scenegraph too and a scene graph can be anything you want it to be. When you start with a game engine you can have an simple array which holds (object/position) pairs. So you can simple traverse this array and draw the objects on their respective position. When going further you can add rotation to that. Most engines will have a tree like scene graph which means that you can have a position/rotation relative to your parent. You can add anything you like to your scenegraph, but what is the most important is that start simple and add later. Once you grasp the basic concept you see that it is not so difficult.

For the optimizing part I would say, optimize when framerate drops. Maybe you will never get to that point. There are several options like frustum culling which you can do when adding spatial information to your scene graph. Like putting AABBs around your objects so you can test them against the frustum.

\$\endgroup\$
1
  • \$\begingroup\$ Not exactly an answer I was hoping for but it got me thinking. Thanks... \$\endgroup\$ Aug 4, 2011 at 23:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .