Hi J-S,
That makes sense and that was exactly my problem.
Cheers I need all the help I can get, I am only a hobbyist and don’t make a
professional career out of it, as you can see ;)

Martin.


-----Original Message-----
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of
Jean-Sébastien Guay
Sent: 21 February 2010 13:44
To: OpenSceneGraph Users
Subject: Re: [osg-users] Viewer and old producer getRenderSurface

Hi Martin,

> When using viewer->run() my scene appears ok and the camera/view appear to
> be outside of the cow, but when updating my scene manually using
> viewer->frame()  I end up viewing inside the cow, how do I set my camera
or
> view position when updating the frame manually, does viewer->run()
calculate
> the view of the entire scene automatically?
> I am slight lost at the moment!!! :)

I saw you got it working, but just so you know there's no magic going 
on, here's the explanation for the above.

viewer->run() automatically attaches an osgGA::TrackballManipulator to 
the viewer. This in turn automatically calculates the view matrix based 
on the scene bounds on the first frame. To get the same behavior when 
using viewer->frame() you would just have to call 
viewer->setCameraManipulator(new osgGA::TrackballManipulator); .

Or you can modify the main camera's view matrix each frame before 
calling viewer->frame(). You can use 
viewer->getCamera()->setViewMatrixAsLookAt(...); for example, or build 
your own view matrix and set it with 
viewer->getCamera()->setViewMatrix(matrix); .

Hope this helps explain it a bit.

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to