Hi Jimmy,
On Tue, Aug 18, 2009 at 10:45 PM, Jimmy Lin<[email protected]> wrote:
> Looking at the CompositeViewer::updateTraversal(), it seems the update
> callback is called before update the view matrix, which mean my slave camera
> is using master camera's previous view matrix. But I think it's allright in
> my case to have 1 frame out of sync.
>
> Just want to know if I want to put my update between the updateTraversal()
> and renderingTraversal(). Does that mean I need to break up the frame()? In
> that case how can I access _firstFrame member and viewerInit() ?
Breaking up frame is trivial, and it's a very common thing to do when
writing a OSG graphics app, viewer.run() and viewer.frame() are just
high level convenience methods that you can use if you don't need fine
control over things. The expanded frame loop simple looks like:
viewer.realize();
while(!viewer.done())
{
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
// do the updates you require
viewer.renderingTraversals();
}
I'm not sure why you'd need an internal variable like _firstFrame in
your code, the expanded main loop should offer plenty of scope for
putting code where you need it.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org