[osg-users] How do I obtain calculated zNear / zFar from an osg::Camera ?

Daniel Holz osgforum at tevs.eu
Fri Mar 13 11:15:15 PDT 2009


Hi everyone,

I am using a camera whose zNear / zFar is calculated automatically and I need to obtain the zNear / zFar values in the camera's PreRenderCallback.
Just trying to use the function camera->getProjectionMatrixAsPerspective(fovy, aspect, zNear, zFar);
always gives me the initial near far plane (0.99 and 9999) and not the automatically computed one (at least zFar should be quite small since my scene is just about 5x5x5 units large).

How do I do it correctly?

Regards
Daniel

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8466#8466








More information about the osg-users mailing list