Hi Prasad,

If I replace viewer->frame() with viewer->run() I can see the geometry.
what is the problem??

This is an FAQ. viewer->run() automatically adds a trackball manipulator to the viewer if there is none (it's a convenience function used in examples so it makes sure everything is set up with as few lines of code as possible). viewer->frame() does not, so you need to add the trackball manipulator yourself (or control the camera in some other way so you see your objects).

The problem is that the camera is not positioned to see your objects. On the first frame, the manipulator will center the camera on your scene. Alternatively, you could just use viewer->getCamera()->setViewMatrixAsLookAt() each frame to move the camera. But using a camera manipulator is the easiest way to have mouse control over the camera, and as a bonus it centers on your objects at startup.

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

Reply via email to