Ajustar el near/far en osg


/ Published in: C++
Save to your folder(s)



Copy this code and paste it in your HTML
  1. double left,right,top,bottom,nearClip,farClip,xshear,yshear;
  2. float hfov,vfov;
  3.  
  4. osgProducer::OsgSceneHandler *sceneHandler = viewer.getSceneHandlerList()[0].get();
  5.  
  6. osgUtil::SceneView *sceneView = sceneHandler->getSceneView();
  7.  
  8. sceneView->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);
  9.  
  10. Producer::Camera *cam = viewer.getCamera(0);
  11. cam->getLensParams(left,right,top,bottom,nearClip,farClip,xshear,yshear);
  12.  
  13. hfov = cam->getLensHorizontalFov();
  14. vfov = cam->getLensVerticalFov();
  15.  
  16. cam->setLensPerspective(hfov,vfov,0.1,500,xshear,yshear);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.