Skip to main content
gamedev.net
🔒 Locked

SceneGraph

Started by Chuck3d 3 replies 750+ views
Original Post
Chuck3d
Chuck3d
What is a scenegraph ? I have built a data base for my game, and I want to know if this is a scenegraph. So what is it? !o)
!o)
jamessharpe
jamessharpe
A scenegraph is a directed non-cyclic graph that represents the relationships between the objects in your scene e.g. a player may be holding a torch in his/her hand. The scene graph would represent this by being the tree like this:


World
-- Player
-- left arm
--left hand
--torch
--right arm
--right hand

Chuck3d
Chuck3d
ok I see, generally, does the scenegraph appears in the game data (trees, class ...)? I want to know if game developer use it, because I have no experiences in game structure.



!o)
!o)
makeshiftwings
makeshiftwings
If you''re doing a 3d game, you should have some type of scene graph. It doesn''t necessarily have to go in the database. The main point of a scene graph is to propagate 3d transformations. For example, old school no-scenegraph games (like quake 1), would have to do strange things to let characters hold a gun. You would animate the character running and waving his arms, and then you would have to save a seperate animation of the gun waving around as if attached to an invisible arm, and then you play them both at the same time to make it look like the character is holding the gun while he''s running around. With a scene graph, you can basically attach any object as a child to any other object and then that object will move along properly with the parent object easily. So you attach the gun or sword or whatever to the character''s hand and when he swings his arms around, the weapon moves properly as well. This is useful all over the place: characters riding in cars, sparks coming off a torch, crates in an elevator, etc.
Chuck3d
Chuck3d
Very good things, I have seen this in Java3D a long time ago, but now i realize I can do it myself (relatively) easily.



!o)
!o)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.