Posted By

buscarini on 07/13/06


Tagged

osg nearfar


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

copyleft


Ajustar el near/far en osg


 / Published in: C++
 

  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  

You need to login to post a comment.