/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
double left,right,top,bottom,nearClip,farClip,xshear,yshear; float hfov,vfov; osgProducer::OsgSceneHandler *sceneHandler = viewer.getSceneHandlerList()[0].get(); osgUtil::SceneView *sceneView = sceneHandler->getSceneView(); sceneView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR); Producer::Camera *cam = viewer.getCamera(0); cam->getLensParams(left,right,top,bottom,nearClip,farClip,xshear,yshear); hfov = cam->getLensHorizontalFov(); vfov = cam->getLensVerticalFov(); cam->setLensPerspective(hfov,vfov,0.1,500,xshear,yshear);