[osg-users] How to query calczulated zNear zFar?

Werner Modenbach Werner.Modenbach at texion.eu
Thu May 17 07:11:09 PDT 2018


Dear all,

I hope someone can help me.
I'm really desperate. I can't find the right way retrieving zNear and
zFar values
from a child camera.
I'm debugging now since many days already without success.
I have a deferred rendering scene. The main camera doesn't have my scane
as child but the rtt-camera.
rtt-camera is set RELATIVE_RF, so it is controlled by the camera
manipulator of the main camera.

What I found out so far:
- The viewer calls "renderingTraversals()"
- The renderer calls "cull()" which starts a cullVisitor.
- When the cullVisitor reaches my child camera it multiplies view and
projection matrices and collects correct
   zNear and zFar values from the cameras child = my scene.
- at the and of apply(const osg::Camera&) the method
"popProjectionMatrix()" is called which cals "clampProJectionMatrix(...)"
- There the projection matrix is modified the correct way according to
zNear and zFar.
- I have set a CullCallback and a PreDrawCallback at my child camera but
none of them can extract zNear and zFar from the cameras ProjectionMatrix.

Is there any other way to get these values which get obviously
calculated the correct way?
I can't find anything in the Internet or in the examples.

Many thanks for any hint.

- Werner -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180517/42378bd9/attachment.html>


More information about the osg-users mailing list