Hi Ruen,
Use viewer.getCamera(). Viewer is subclassed (via osgViewer::View)
from osg::View which provides the master Camera for that view.
The Viewer::getCameraWithFocus() method just provides the camera that
currently has event focus.
Robert.
On 7/1/07, Ruben <[EMAIL PROTECTED]> wrote:
Hello,
I need to change the camera FOV, in an application with
osgViewer::Viewer, and the way that I have seen is this one:
osg::Camera *camera = viewer.getCameraWithFocus();
if (camera) {
camera->setProjectionMatrix(osg::Matrix::perspective(fov, ratio, near,
far));
}
The problem is that this if condition isn't always true. In fact before
I move the mouse for the first time, the camera is NULL. My app doesn't
need the mouse, how can I solve this issue?
Thanks.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/