Hello Sajjad,
I am attaching a pdf file that gives a brief overview of the scene graph
concept and i would like to know which files in the source
implement these( opengl commands specified in the attached file) down
the hood.
You want us to tell you how to implement what is given in OpenGL
pseudo-code in Figure 2 and Figure 4 of the PDF? It's rather basic,
there's nothing really complicated there...
I would suggest you look at some of the (very numerous) examples that
come with OSG. I will give you a quick summary:
Actual geometry is stored in osg::Drawables (and subclasses). Raw
geometry is osg::Geometry, but you can also use osg::ShapeDrawable with
osg::Shape's subclasses to make simple shapes such as spheres, boxes, etc.
The scene graph is composed of osg::Nodes (and subclasses). The class
hierarchy looks like this:
osg::Node (does nothing interesting other than being the parent class)
osg::Group (has a vector of children)
osg::Transform (parent class of all concrete transform types)
osg::MatrixTransform (transforms children's coordinate systems)
osg::PositionAttitudeTransform (this too, another type)
osgSim::DOFTransform (still a transform)
osg::Switch (allows you to turn on/off its children)
osg::Geode (contains Drawables - leaf node)
There are other types, but these are the basic types.
So in OSG, the equivalent of the OpenGL code in Figure 2 might be:
osg::Group
osg::Geode --> osg::Geometry (for the dial)
osg::MatrixTransform
osg::Geode --> osg::Geometry (for one hand)
osg::MatrixTransform
osg::Geode --> osg::Geometry (for the second hand)
When you traverse the graph from the top, you can think of a
MatrixTransform as a glPushMatrix when you enter it, then traverse its
children, then a glPopMatrix when you exit and go back to its parent.
For more details, please read the OpenSceneGraph Quick Start Guide,
which is very useful to understand the basic concepts of OpenSceneGraph.
It's free at http://www.osgbooks.org/ . Also, the doxygen generated
documentation can help you understand the class hierarchies. For
example, this page shows the inheritance diagram for osg::MatrixTransform:
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01482.html
(Note that a red box means there are parent classes which were
truncated. In this case, osg::Group is a subclass of osg::Node, which is
a subclass of osg::Object, which is a subclass of osg::Referenced. Whew!
:-) Click on the osg::Group box to see more.)
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org