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

Robert Osfield robert.osfield at gmail.com
Thu May 17 09:49:48 PDT 2018


Hi Werner,

You have a complicated enough scheme that just reading a general
description really isn't sufficient to understand what is being down
when etc.  So best I can is provide general suggests.

Would a CullSettings::ClampProjectionMatrixCallback help?  Might
enable you to intercept or set the values and do what you want with
them.  This will be called in Cull traversal at the appropriate time.
I don't recall the details, it's probably well over a decade since I
looked at this code.

Robert.



On 17 May 2018 at 15:11, Werner Modenbach <Werner.Modenbach at texion.eu> wrote:
> 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 -
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list