Advertisement Jump to content
Sign in to follow this  

OpenGL OpenGL + SceneGraph question

This topic is 4913 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I am writing my scene graph like so: SceneNodes are abstract, but contain a child vector and transformation vector. Transformations consist of translations, rotations, and scaling. Now, I have my renderer go through the scene graph and ask what kind of node the scenenode is (geometry node or switch node). I (unfortunately) have realized that what I probably should have done was have transformation nodes, and simply use glPushMatrix everytime I hit a RenderNode and glPopMatrix everytime we recurse back -- but that seems sloppier than the other way I thought of. Since each scenenode has an abstract upadte() method, which updates itself using the transformations and then updates its children, I figured I could use some sort of matrix to store the update, and when rendering, just push that matrix. So I need to do some matrix multiplication, right? I figured each sceneNode would hold its own matrix, and when I call Update(dt) on my scenegraph (which I do at a seperate time from render), it would recreate the matrix, and then when I render, just push that matrix. Does that sound good? Unfortunately, Beginning OpenGL Game Programming doesn't go into detail at all about how I could do this. Can someone give me a quick rundown or a simple tutorial? I plan on making my matrix GLFloat matrix[16] (I don't want to deal with the row-major column-major bullshit that OpenGL seems to have with C++ [wince]), and my translation, rotation, and scaling values are all stored as 3 floats. Should I just redesign my scene graph? Time to go re-read 3D Game Engine Design... <3 visage

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!