# Thread: What is a scene graph?

1. ## What is a scene graph?

So far, it makes sense to me why you would put objects in a hierarchy in relation to other, where objects "down the hierarchy" inherit the transformations of the object above it. So like a sword, in addition to its own transformations, inherits the transformations of the person holding it, which in turn inherits the transformation of the horse it's on.

This technique is explained in depth here:
http://www.arcsynthesis.org/gltut/Po...0Matrices.html

Where does the idea of a "scene graph" come into play? I tried reading the wikipedia article: http://en.wikipedia.org/wiki/Scene_graph
But it does not really make sense to me why they use a graph or tree to model an entire scene. What I would do is just keep all the objects in a list and render them in order (maybe after some frustum culling), using the "hierarchy" technique as needed. Why do we need a tree or graph model?

2. ## Re: What is a scene graph?

You seem to be saying:

I can put all my drawing into a simple scene graph and render that.

Why would I need a scene graph then?

Good question.

Bruce

3. ## Re: What is a scene graph?

This technique is explained in depth here:
http://www.arcsynthesis.org/gltut/Po...0Matrices.html

Where does the idea of a "scene graph" come into play?
That is a scene graph. Just because that tutorial didn't call it a "scene graph" doesn't mean that it isn't.

The parent-child relationship of nodes in the scene is a data structure called a tree. Trees are a restricted form of graph. So you have a scene of nodes in a graph. Scene graph.

Indeed, the "Further Study" section of that tutorial has this:

Originally Posted by Further Study
Reimplement the Hierarchy tutorial, instead using a more generic data structure. Have each node be a struct/class that can be attached to an arbitrary node. The scene will simply be the root node. The individual angle values should be stored in the node object. The node should have a render function that will render this node, given the matrix stack. It would render itself, then recursively render its children. The node would also have a way to define the size (in world-space) and origin point of the rectangle to be drawn.
This is could more easily called "Implement a generalized scene graph."

4. ## Re: What is a scene graph?

A quite informative survey about scene graphs, although a bit dated, can be found here:

http://www.realityprime.com/articles...ent-and-future

Please note, the über-scene-graph approach, as proposed in literature on 3D engines etc. is considered outdated even by their authors.

Über-scene-graph meaning that you want to centralize all tasks, all responsibilitites and all rendering, state management, animation a.s.o. in a single data structure.

Edit: I just remember the crucial observation made by Gregory in Game Engine Architecture, that the choice of data structure to represent the scene is highly dependent on the type of application. You need to find out what your app needs and then select the appropriate data structure. Not just code a huge system and find out it doesn't exactly fit your purpose.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•