Scene Graphs?
-
- Posts: 5
- Joined: Sat Nov 13, 2004 4:52 am
Scene Graphs?
I am looking at different game engines. I've noticed that the Irrlicht engine is very fast and I love the fact that it's platform independant. I'm thinking about modding it a little for my purposes or I'll just make my own. My question is how do you structure a scene graph? I understand you attach children objects to parent objects, but what's the level of importance? I mean, in my game engine. should I have a character at a set level in the scene graph, or could I put a variable in determining what level it was. (Basically I could make it the "scenery" level if I wanted.) Any web pages or if you want to waste your time on me by explaining, would be greatly apprieciated. Thank you in advance.
Irrlicht is based on the Scene Manager system (the correct term for Irrlicht is Scene Manager, not Graph). The Scene Manager holds all information about what you can see. You use this manager to add billboards, meshes, cameras, etc. ... You can store the return value of such "adding process" in a pointer to the type. E.g.: store the return of addCameraSceneNodeFPS() in an ICameraSceneNode variable. The Scene Manager keeps track of everything that was added/modified in order to render it in the draw loop.
All the things you add can be independant. There isn't really a relationship between them at client-coding level (in the source you'll see everything is inherited from ISceneNode but that doesn't matters now). The relationship child-parent is created for some situations like attaching a weapon to a camera (weapon is a child of the camera). Then they will move, rotate and scale together.
Check out some examples. If you don't understand something, just ask. But you'll understand it fast I think .
All the things you add can be independant. There isn't really a relationship between them at client-coding level (in the source you'll see everything is inherited from ISceneNode but that doesn't matters now). The relationship child-parent is created for some situations like attaching a weapon to a camera (weapon is a child of the camera). Then they will move, rotate and scale together.
Check out some examples. If you don't understand something, just ask. But you'll understand it fast I think .
-
- Posts: 5
- Joined: Sat Nov 13, 2004 4:52 am
A scene graph is just a system that uses a parent->child system, with the child inheriting things like position so that you can set positions relative to the parent. It's another Ameicanism of making things sound more complicated than they are, until you need something to stay in a relative position to another node ( like a weapon attached to a character ) you don't need to worry about it at all. Just remember it exists.