Hi Robert

I'm using osgProducer::Viewer. I'm adding a post-draw callback with
viewer.getCamera(0)->addPostDrawCallback(myCallback). I retrieve the
same projection matrix from a cull callback as I do from the draw
callback. I can observe the correct near/far changes from automatic
near/far generation in the cull callback using
cv->getCalculatedNearPlane() and cv->getCalculatedFarPlane().

Thanks,
Bob Doyle


>Hi Robert,
>
>What viewer setup (i..e osgProducer::Viewer/osgViewer::Viewer) do you have?
>
>Robert.

On 5/3/07, Robert Doyle <[EMAIL PROTECTED]> wrote:
>
>
> Hello OSG users:
>
> I'm attempting to get object coordinates from Z-buffer values using the
> projectWindowIntoObject() method (similar to gluUnproject()) found in
> SceneView. This works fine if DO_NOT_COMPUTE_NEAR_FAR is set. But if the
> default automatic generation of near and far clipping planes is used,
> the calculated object coordinates are wrong. Clearly some scaling needs
> to be done to correct for the new z-near and z-far.
>
> I would like to get the valid projection matrix to simplify the task.
> But the projection matrix retrieved in a camera post-draw callback does
> not include the generated clipping planes. In other words, it's the same
> whether automatic generation z-near and z-far is enable or disabled.
> This is also true if I use glGetDoublev(GL_PROJECTION_MATRIX,
> projMatrix).
>
> So, my question is: Is it possible to retrieve the correct projection
> matrix or do I need to generate my own projection matrix using something
> similar to the clampProjectionMatrix() function in the CullVisitor.
>
> Thanks,
> Bob Doyle
> _______________________________________________
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to