Hi Robert,

I'm having the same problem as well. It seems to happen when there are no drawable objects in the view. The fact that it's automatically calculated is fine but the degenerate projection matrix you sometimes get is not. For me, it's breaking code meant to map pixels to positions on a plane in the world.

Unfortunately, I don't have a good answer for how to fix this. Hopefully someone will make a patch dealing with this, but for the time being it might make sense to compute the near/far planes manually.

- Eron

Robert Doyle 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/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to