• Advertisement
Sign in to follow this  

2D Scenegraph system

This topic is 4041 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

Hello! Now that I've completed lower-level parts of my engine (windowing / rendering API abstraction, etc), I'm ready to dive into something new : Building a scenegraph system. However, I don't think I am ready yet to build a 3D Scenegraph system so I'd like to start out with a 2D one first. The project in which I will be using this is a side-scrolling space-shooter game. As I've never programmed such I thing, I'd like some tips/help/ressources on how to get started. I'd like to know : 1- General theory about what a scenegraph is, how it works, how to build one and such 2- Which data must be stored at each node? (World transform, Z-value, bounding box?) 3- Must all of the level objects be loaded at the beginning but only updated/rendered when they come into the viewing frustrum? 4- Which classes should be created and what should their individual tasks be? (exemple : class RootNode, Node, Entity, SceneGraph) If anyone has done such a thing, I'd like some infrmation to get started well. Thanks a lot

Share this post


Link to post
Share on other sites
Advertisement
Here's an excellent article on the history and use of scene graphs.

http://www.realityprime.com/scenegraph.php

Scene graphs are just hierarchical data structures that you use to organize the objects in your game. That organization, and why you are doing it, is completely up to you.

You might arrange your objects by their texture file in order to minimize the number of rendering API state changes that occur when drawing the scene. You might also sort your objects by their position to speed up collision detection or frustrum culling.

Share this post


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

  • Advertisement