Discussion:
how to se the near and far clip plane?? (setProjectionMatrixAsPerspective not working)
David _
2008-04-30 12:56:20 UTC
Permalink
Hi

i would like to manually specify the near and far clip planes of the camera

right now iŽm using something like this

osg_viewer->getCamera()->setProjectionMatrixAsPerspective(90.0, 1.333, 0.001, 100);

the documentation says this

void setProjectionMatrixAsPerspective (double fovy, double aspectRatio, double zNear, double zFar)

the FOV and aspect ratio parameters are working, but no matter the values i write in the last two parameters, the clip planes distance remains the same

any idea?

thanks

_________________________________________________________________
Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar siempre a la última
Guapos y guapas, clips musicales y estrenos de cine.
Thrall, Bryan
2008-04-30 13:48:48 UTC
Permalink
Post by David _
Hi
i would like to manually specify the near and far clip planes of the camera
right now i´m using something like this
osg_viewer->getCamera()->setProjectionMatrixAsPerspective(90.0, 1.333, 0.001, 100);
the documentation says this
void setProjectionMatrixAsPerspective
<http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01059.html#a35>
(double fovy, double aspectRatio, double zNear, double zFar)
the FOV and aspect ratio parameters are working, but no matter the
values i write in the last two parameters, the clip planes distance
remains the same
any idea?
Try:

osg_viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

Then setProjectionMatrixAsPerspective should work. (By default, OSG automatically computes the near and far planes based on the scenegraph geometry)
--
Bryan Thrall
FlightSafety International
Bryan.Thrall-***@public.gmane.org
David _
2008-04-30 13:57:41 UTC
Permalink
it works now

thanks
Date: Wed, 30 Apr 2008 08:48:48 -0500
Subject: Re: [osg-users] how to se the near and far clip plane?? (setProjectionMatrixAsPerspective not working)
Post by David _
Hi
i would like to manually specify the near and far clip planes of the camera
right now iŽm using something like this
osg_viewer->getCamera()->setProjectionMatrixAsPerspective(90.0, 1.333, 0.001, 100);
the documentation says this
void setProjectionMatrixAsPerspective
<http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01059.html#a35>
(double fovy, double aspectRatio, double zNear, double zFar)
the FOV and aspect ratio parameters are working, but no matter the
values i write in the last two parameters, the clip planes distance
remains the same
any idea?
osg_viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
Then setProjectionMatrixAsPerspective should work. (By default, OSG automatically computes the near and far planes based on the scenegraph geometry)
--
Bryan Thrall
FlightSafety International
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_________________________________________________________________
MSN Video.
http://video.msn.com/?mkt=es-es
Mike Weiblen
2008-04-30 17:15:35 UTC
Permalink
fyi, try exploring

osgthirdpersonview cessnafire.osg

for a vibrant visualization of OSG's automatic near/far computation.

-- mew
-----Original Message-----
Sent: Wednesday, April 30, 2008 8:49 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] how to se the near and far clip
plane??(setProjectionMatrixAsPerspective not working)
Post by David _
Hi
i would like to manually specify the near and far clip planes of the camera
right now i´m using something like this
osg_viewer->getCamera()->setProjectionMatrixAsPerspective(90.0, 1.333, 0.001, 100);
the documentation says this
void setProjectionMatrixAsPerspective
<http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDoc
s/a01059.html#a35>
Post by David _
(double fovy, double aspectRatio, double zNear, double zFar)
the FOV and aspect ratio parameters are working, but no matter the
values i write in the last two parameters, the clip planes distance
remains the same
any idea?
osg_viewer->getCamera()-
Post by David _
setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
Then setProjectionMatrixAsPerspective should work. (By default, OSG
automatically computes the near and far planes based on the scenegraph
geometry)
--
Bryan Thrall
FlightSafety International
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-
openscenegraph.org
Loading...