Hi Paul,

On 5/30/07, Paul Martz <[EMAIL PROTECTED]> wrote:
I'm confused about this. We're discussing the osgviewer application, right?
I wasn't aware that osgviewer allowed the user to add their own update
traversal, or allowed the user to modify the view after the update
traversal. As far as I can see from looking at the code, osgviewer sets the
view in the event traversal with, say, a TrackballManipulator.

osgViewer::Viewer is extensible, you can subclass from it to override
the various traversals.

You can also use it are several levels of granulatity i.e.

 viewer.run();

OR

 viewer.realize();
 while(!viewer.done())
 {
    viewer.frame();
 }

OR

 viewer.realize();
 while(!viewer.done())
 {
    viewer.advance();
    viewer.eventTraversal();
    viewer.updateTraversal();
    viewer.renderingTraversals();
 }

With the last one you can do:

 viewer.realize();
 while(!viewer.done())
 {
    viewer.advance();
    viewer.eventTraversal();
    viewer.updateTraversal();

    viewer.getCamera()->setViewMatrix(computeMyViewMatrix());

    viewer.renderingTraversals();
 }

W.r.t the proposal of having a renderingTraversals() callback, this
would provide an alternative to subclassing from Viewer, but still
allow one to override the renderingTraversals() implememtation and
catch what the getCamera()->getViewMatrix() is.

Robert.
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to