2D Scenegraph system

Started by
0 comments, last by Penance 17 years, 2 months ago
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
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.

This topic is closed to new replies.

Advertisement