Hi Arfaa,
here is my implementation:

Code:
bool ViewerWidget::setMainCameraFieldOfView(double iFov)
{
   osg::Camera* camera = mainView()->getCamera();
   double fovy, aspectRatio, zNear, zFar;
   bool result = camera->getProjectionMatrixAsPerspective(fovy, aspectRatio, 
zNear, zFar);
   if (true == result) {
      camera->setProjectionMatrixAsPerspective(iFov, aspectRatio, zNear, zFar);
   }
   return result;
}



ViewerWidget inherits from osgViewer::CompositeViewer. Anyway what I notice on 
your code is that you use a CameraViewer while I set the FOV to a osg::Camera. 
You could try the code on a osg::Camera and if it works then I guess there is 
something to investigate on the CameraViewer side.

HTH, Gianni

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71467#71467





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to