Hi elekis

You can use an osg::Switch node on top of your two scenes:

osg::Switch *switchRoot = new osg::Switch()
... your nodes...

switchRoot->addChild(root);
switchRoot->addChild(root2);
switchRoot->setSingleChild(0);

...

When you want change to the root2 scene only do:
<http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/classosg_1_1Switch.html#a17>
switchRoot->setSingleChild(1);

Hope this helps to you.

Remember that you only can change the scene only after sync() and before
frame() calls.

--
Rafa.



On 2/8/07, elekis <[EMAIL PROTECTED]> wrote:

hi all

I have a little probleme,

I have two node who represent two differents things,

and I would like to render one, and afer pushing a touch, changing on
other

something like that
//init
osg::Group* root = new osg::Group();
osg::Group* root2 = new osg::Group();
viewer.setSceneData( root );

// after a action
viewer.setSceneData( root2 );

// after a other action
viewer.setSceneData( root );

I trying that, but that doesn't work.  (root 2 is accepted but core dumped
just after)


is it possible to do that??

other thing
I dunno if it's normal but

http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/classosgProducer_1_1Viewer.html

there are no getSceneData or my viewer is a osg::Producer


thanks a+++




_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to