   Who uses scene graphs?
  I was trying to think of a way to implement a scene graph while still being able to batch by texture etc., but then started to wonder if they are even needed. Say for an outdoor scene, you might have something like this:  root | ---------------------------------------- |   ||    |   |   Landscape  Player   Obstacle   Enemy    EnemyWhich ends up being a very flat scenegraph. Now, why not just store everything in an array, then batch them each frame and render them? I was just curious as to who actually uses scene graphs and   batching, and how they do it.   ---------------------------------------Let''s struggle for our dream of Game!http://andrewporritt.4t.com
  If you had vehicles on your landscape, and the player climbed into a vehicle, then the player would become a child of the vehicle (so you wont have to worry about transforming the player when the vehicle moves).I use a scenegraph - because having each node carry forward its trasform to its children is pretty usefull.Hope that helps mate.Jim;  Unconstrained graphs don''t have roots... ;  A common way is a render manager... That is to say, that you traverse the scenegraph... then feed pointers to everything that needs drawing to a rendermanager... that sorts them appropriately before actually rendering. This is the stage in which you can sort your transparent objects... or group by texture etc. ;  I''ve always wondered what to do with the transforms at the moment of sorting. You''d need to store the final transform for each object as well when you sort them. How would one go about doing that? I can''t imagine pulling the matrix from OpenGL every time, and it doesn''t seem correct to do all matrix math on the CPU as well. ;  Traverse the graph, and for all visible objects create their final transformation matrix. Then sort by state using the final matrix for each chunk when you actually render.Actual matrix multiplication is pretty tiny when you compare it to all the maths going on to project and draw your triangles. So its not a problem to do it on the CPU.Btw, the term ''scene graph'' is pretty general, it can be a full-on DAG with shared geometry and chained transformations etc. etc. or it could just be a simple list of all the objects and lights in your world. ;  okay, thanks. I guess I''m off to write a matrix class to accompany my vector class. ;  I''ve only skimmed this thread, but I think we discussed this topic recently here.Kyle N