[osg-users] Getting the "depth clamped" projection matrix of a CameraNode
Robert Osfield
robert.osfield at gmail.com
Fri Dec 7 07:58:43 PST 2007
On Dec 7, 2007 3:34 PM, Alan Purvis <alanpurvis at eircom.net> wrote:
> Does anyone have an idea what I might be doing wrong? Am I right to
> call traverse before I deference the pointer to the matrix? Am I
> getting a pointer to the right matrix?
Reading through your you email the reason pinged into my head. Your
not doing anything wrong in terms of accessing the projection matrix,
the problem lies in the fact that the cull visitor does the clamping
of the projection matrix once its traversed the whole subgraph below a
camera - which will be after your cull callback returns. The actual
clamping is dispatched within the CullVisitor;:popProjectionMatrix()
method.
Looking at your code you are setting a uniform with the projection
matrix. Perhaps you can dispense with this completely as OpenGL
itself has the projection matrix as a built in uniform.
Robert.
More information about the osg-users
mailing list