Hi Bob,

The default setting of the view matrix is done at the end of
Viewer::updateTraversal(), after the update visitor runs through the
scene graph calling update callbacks.  This is done so that any camera
manipulators that track nodes can set themselves correctly.

In your case you are looking for the camera position before its been
set so in effect you only have the previous frames value.  To get the
correct value in an update callback you'll need to either dispense
with using camera manipulators and set the view matrix yourself, or
override the updateTraversal() so that the camera manipulators are set
before the update traversal.  The updateTraversal() method is
deliberately written as a virtual function to allow you to customize
it in such a way.

Robert.

On Mon, Aug 25, 2008 at 2:49 PM, Bob Balfour <[EMAIL PROTECTED]> wrote:
> I have an update callback that needs the current frames (i.e. the one that's
> about to be rendered with the cull/draw traversals to follow) eyepoint.
>  When I used the camera's view matrix, I seemed to be getting last frame's
> eyepoint - it hadn't been updated yet?  When I changed my update callback to
> use the current matrix manipulator (fly,drive,etc) eyepoint, which had
> already been updated in the event traversal, I now got this frame's current
> eyepoint.  Making my update callback a cull callback using the camera view
> matrix also worked.
>
> Is there a "good" way to get the current, updated eyepoint in an update
> callback?  When does the camera view matrix become current?
>
> Thanks.
>
> Bob.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to