HI Allen,

viewer.frame() calls viewer.updateTraversal(), and viewer.run() calls
viewer.frame() so your suggest frame loop would only call
updateTraversal() twice.

Instead to expand viewer.run() -> a frame loop with it's component
parts you do (please look at the implementation itself to confirm
this):

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

You can of course insert your own updates into this frame loop, or
just use an update callback on a node.

Robert.

On Mon, Apr 20, 2009 at 9:21 PM, Allen Saucier <[email protected]> wrote:
> Hey,
> here's the article Paul is speaking about&#058;
> http://forum.openscenegraph.org/viewtopic.php?t=2190
>
> I'm one of the guys in that discussion.  I asked how to modify a line 
> dynamically.
>
> Since you're using viewer.run(), that makes life difficult.  I believe you'll 
> need to use the viewer frame loop instead.  Something like:
>
>  viewer.setSceneData(rootnode.get());
>  viewer.realize();
>
>  while (!viewer.done())
>  {
>    viewer.updateTraversal();
>    viewer.frame();
>  }
>  return 1;
>
>
> The above code allows you to put calls w/in the while loop that will modify 
> your cones/cylinders etc... by changing the states of the cones or modifying 
> their colors.
>
> Hope this helps.
>
>
> Here's a great place to start:
>
> http://www.openscenegraph.org/documentation/NPSTutorials/
>
> http://www.cs.umu.se/kurser/TDBD12/VT04/lab/osg/html/examples.html
>
> http://www.cs.clemson.edu/~malloy/courses/3dgames-2007/tutor/index.html
>
>
> http://www.palomino3d.com/pal_com/openscenegraph/
>
> ------------------------
> Allen
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10477#10477
>
>
>
>
>
> _______________________________________________
> 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