Re: [osg-users] How to change "field of view"(FOV), distance.

2017-08-22 Thread Maxim Senin
Hi,
thanks guys!!! Task resolved!
... 

Thank you!

Cheers,
Maxim

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





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


Re: [osg-users] How to change "field of view"(FOV), distance.

2017-08-21 Thread Gianni Ambrosio
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to change "field of view"(FOV), distance.

2017-08-18 Thread Johny Canes
Hi,


Code:
double fovy, aspectRatio, zNear, zFar;
_camera->getProjectionMatrix().getPerspective(fovy, 
aspectRatio, zNear, zFar);

double aspect = (double)scrw / (double)scrh;
_camera->getProjectionMatrix().makePerspective(45, 
aspect, zNear, zFar);



Thank you!

Cheers,
Johny

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





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


[osg-users] How to change "field of view"(FOV), distance.

2017-08-07 Thread Maxim Senin
Hi,
How to change "field of view"(FOV) and distance?
I used :
... 

Thank you!

Cheers,
Maxim
Code:
osg::CameraView* cameraview = new osg::CameraView();
cameraview->addChild(group);
cameraview->setFieldOfView(120.0f);
osgViewer::Viewer viewer;
viewer.setSceneData(cameraview);



but it's not work. Help me please.

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





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