Post by DarkPikachu on May 25, 2014 10:35:15 GMT -5
A Scene Graph in 3D applications is an efficient way to structure 3D data.
(among other efficient, more direct, methods)
There is no particular method for a single "proper" because programmers usually write different methods for how a scene graph can be used.
A scene graph provides a means of simple traversal between parent and child scene-nodes.
scene-nodes can also be referred to as objects in 3D APIs.
In my API, (Universal Model Converter), I've defined a CPU-side scene graph for storing and converting 3D data.
here's my implementation, for an example of how to structure a scene graph:
[glow=none][tree]
[node]Root
[node]Scene
[node]Object
...
[/node]
[node]Object
...
[/node]
[/node]
[node]Scene
...
[/node]
[/node]
[node]Root
...
[/node]
[/tree][/glow]I don't exactly pull off the traversal as most implementations do.
Most implementations often have a single parent node with multiple child nodes as an array.
My implementation has only a single child, but also defines the next and prev nodes of this parent's children.
The traversal is an instance reference in the scene/object instances themselves.
I find this method to be a little more efficient in terms of memory use.
here's a few other examples (in GLSL):
pyopengl.sourceforge.net/context/tutorials/shader_12.html
www.lighthouse3d.com/cg-topics/code-samples/importing-3d-models-with-assimp/
more information and a better description of a scene graph can be found on the wiki:
en.wikipedia.org/wiki/Scene_graph
(among other efficient, more direct, methods)
There is no particular method for a single "proper" because programmers usually write different methods for how a scene graph can be used.
A scene graph provides a means of simple traversal between parent and child scene-nodes.
scene-nodes can also be referred to as objects in 3D APIs.
In my API, (Universal Model Converter), I've defined a CPU-side scene graph for storing and converting 3D data.
here's my implementation, for an example of how to structure a scene graph:
[glow=none][tree]
[node]Root
[node]Scene
[node]Object
...
[/node]
[node]Object
...
[/node]
[/node]
[node]Scene
...
[/node]
[/node]
[node]Root
...
[/node]
[/tree][/glow]I don't exactly pull off the traversal as most implementations do.
Most implementations often have a single parent node with multiple child nodes as an array.
My implementation has only a single child, but also defines the next and prev nodes of this parent's children.
The traversal is an instance reference in the scene/object instances themselves.
I find this method to be a little more efficient in terms of memory use.
here's a few other examples (in GLSL):
pyopengl.sourceforge.net/context/tutorials/shader_12.html
www.lighthouse3d.com/cg-topics/code-samples/importing-3d-models-with-assimp/
more information and a better description of a scene graph can be found on the wiki:
en.wikipedia.org/wiki/Scene_graph