We Recommend

C++ The Core Language C++ The Core Language
C++: The Core Language is for C programmers transitioning to C++. It's designed to get readers up to speed quickly by covering an essential subset of the language. The subset consists of features without which it's just not C++, and a handful of others that make it a reasonably useful language.


Posted By

buscarini on 07/13/06


Tagged

osg nearfar


Versions (?)


Who likes this?

1 person has 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.