Scenegraph newbie

Post: #1
I'm trying to add a scenegraph to my engine and want to make sure my understanding of it makes sense. I've read all the articles on gamedev and looked at ogres code mostly.

So the scenegraph itself is mainly to denote hyrarchy and group objects together. Every node can have a material attached, a mesh, a light, a shader program, etc. To update the scene a traversal goes through and calls update on every node which will update the animation associated with the node. On a rendering traversal, it will keep track of the absolute position matrix as it goes down and set each nodes absolute matrix, resetting it to the parents matrix for each new child. With its absolute matrix, every node adds itself to some rendering queue and adds any lights to the rendering state. The renderer then sorts the queue by the material / shader programs and uses their mesh as a vertex array with the associated material properties. Or should it let every model have its own drawing function and draw themselves? Does this make sense or have I got it all wrong?

Quote this message in a reply
Posts: 148
Joined: 2003.03
Post: #2
Looks like you got it right. I'm new to scene graphs and am also architecting my own implementation. From my experiences, there are 2 different types of scene graphs. One is suited primarily for pure graphics rendering. The other is a 'hybrid' suited not only to handle graphics rendering, but to also handle the semantics of the game/simulation. I chose to go with the latter as the goals I have with my engine call for it.
Quote this message in a reply
Post: #3
Quote:also handle the semantics of the game/simulation

How would you integrate collision detection into the scenegraph? I'd imagine my scenegraph is pretty flat, with nodes like: level-> terrain->people/buildings/trees/etc. So it would be order n for each collision check more or less? Would you have a seperate graph as an octree with pointers to the scene nodes and organize them by their bounding boxes, or could that be slow updating bounding boxes in the scene graph and then doing a collision check in the octree?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Populating a scenegraph and Dynamism hangt5 6 4,205 Oct 17, 2005 04:32 AM
Last Post: TomorrowPlusX