Hi Mitch,

Simple change will get it working:

On 9/29/06, Mitch Patenaude <[EMAIL PROTECTED]> wrote:
Hi all!

  I am using the ProducerViewer and I want to modify my near and far plane.  I know I have to tell OSG I don't want it to compute the plane so I add this line:

mOSGProducerViewer->getCullSettings().setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR );

This seems to work.  But then, I want to set my near and far plane.  I use this code but it doesn't seems to work.  It seems to keep the default value (near = 1 and far =1000000)
  ...
  Producer::Camera* mCamera = new Producer::Camera;
  ...
  osg::Matrix::value_type* wMatrixVT = mCamera->getProjectionMatrix();
  Producer::Matrix wProdMat(wMatrixVT);
  osg::Matrixd wMat(wMatrixVT);
  double wFovy,wAspect,wNear,wFar,wXs,wYs;
  wMat.getPerspective(wFovy,wAspect,wNear,wFar);
  wMat.makePerspective(wFovy,wAspect,0.0000001,10);
  wProdMat.set(wMat.ptr());
  //mCamera->setViewByMatrix (wProdMat);

       mCamera->getLens()->setMatrix(wProdMat.ptr());

Is this the good way to do it?  Does anybody have an idea on how to do it?
Thanks!
Mitch


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to