diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index 7942202d2..cb40983b7 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -126,12 +126,9 @@ int main( int argc, char **argv ) float socketNumber=8100.0f; while (arguments.read("-n",socketNumber)) ; - float camera_fov=45.0f; + float camera_fov=-1.0f; while (arguments.read("-f",camera_fov)) { - std::cout << "setting lens perspective : original "<0.0f) + { + float aspectRatio = tan( osg::DegreesToRadians(viewer.getLensVerticalFov()*0.5)) / tan(osg::DegreesToRadians(viewer.getLensHorizontalFov()*0.5)); + float new_fovy = osg::RadiansToDegrees(atan( aspectRatio * tan( osg::DegreesToRadians(camera_fov*0.5))))*2.0f; + std::cout << "setting lens perspective : original "<