Hi Oual

On 9/9/06, Paulp1 <[EMAIL PROTECTED]> wrote:
Hi,
I'm currently loading models from my application into OSG however I'm having trouble resetting the osgProducer::viewer to look at the center
 of the scene graph and to reset the trackball manipulator. I'm currently setting the view Matrix with:
 
const osg::BoundingSphere& bs = loadedModel->getBound();
osg::Matrix myviewMatrix;
viewMatrix.makeLookAt(bs.center()-osg::Vec3(0.0,2.0f*bs.radius(),0.0),bs.center(),osg::Vec3(0.0f,0.0f,1.0f));
viewer->setView (myviewMatrix); 

You need to do this setting of the view matrix after then update traversal as the updated traversal grabs the current view matrix from the camera manipulators on each frame.

If you want to set the home position of the manipulator get the pointer to the current manipulator and use setHomePosition().

Robert.
 


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to