Thanks for the very helpful guidance you provide.
In the MFC example, I think the .run() method is already replaced by this:
//viewer->run();
while(!viewer->done())
{
osg->PreFrameUpdate();
viewer->frame();
osg->PostFrameUpdate();
}
I understand your suggestion about the details in the frame() call. Here's
more detail about my intended use:
For example, I want the user to be able to spin the model and look at it,
but then click a start button and then (ignoring the user inputs)
systematically traverse an axis between some values, and/or viewing angles,
and then when finished, let the user look at it again (with the rendering
details changed (color transparency, other textures, etc.).
I was thinking I could stop the normal viewer threading that responds to
user input and then drive it myself from another function.When finished I
would restart the viewer to respond to user input. There's probably a
better way.
Would I be better off using update traversals, animation stuff, or some
other osg design I haven't learned yet?
How about osgPPU? What do you think of it?
Thanks,
bob
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert
Osfield
Sent: Monday, April 06, 2009 2:37 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] start/stop viewer
Hi Bob,
The viewer only renders a frame when you call viewer.frame(). If you are
calling the convenience function viewer.run() then just replace this run
call with the constuent parts of Viewer::run() i.e.
while(!viewer.done())
{
viewer.advance();
viewer.eventTraversal();
viewer.updateTraversal();
viewer.renderingTraversals();
}
Robert.
On Mon, Apr 6, 2009 at 6:56 PM, Bob Youmans <[email protected]> wrote:
Hello osg-list,
I'd like to find the best way to adapt osg::viewer to control its rendering:
in one case I want the usual case where viewer->run is doing its thing at 60
fps. But, then, I have other GUI windows (MFC-based) and I want to stop the
viewer, and then render a single frame, all using the same geometry. What's
the best approach for such a design? Can I (using the examples for MFC)
call viewer->stopThreads and then "manually" render a single frame, and then
call run, startThreads, etc. subsequently, and repeat this as often as I
like?
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