[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?


Read this topic online here:

More information about the osg-users mailing list