Hi,

i created a menu where i can select a model. When i select a button a fuction 
loads the nodes with the following code:

Code:

 listaComponenti.push_back(osgDB::readNodeFile("aorta.ive"));
    listaComponenti.push_back(osgDB::readNodeFile("cuore.ive"));

    unsigned int ii;
    for(ii=0; ii < listaComponenti.size(); ii++)
        switchA->addChild((listaComponenti[ii]), true);

    root->addChild(switchA.get());



In the main fuction i have this code:

Code:

if(!wm) return 1;

    osg::Group*  group  = new osg::Group();
    osg::Camera* camera = wm->createParentOrthoCamera();

    group->addChild(camera);

    if(root) group->addChild(root);

    viewer.addEventHandler(new osgWidget::MouseHandler(wm));
    viewer.addEventHandler(new osgWidget::KeyboardHandler(wm));
    viewer.addEventHandler(new osgWidget::ResizeHandler(wm, camera));
    viewer.addEventHandler(new osgWidget::CameraSwitchHandler(wm, camera));
    viewer.addEventHandler(new osgViewer::StatsHandler());
    viewer.addEventHandler(new osgViewer::WindowSizeHandler());
    viewer.addEventHandler(new 
osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));

    wm->resizeAllWindows();

    viewer.setSceneData(group);
    
    /*********************************************************/
    
    
    //viewer.getCamera()->setClearColor(osg::Vec4(0.,0.,0.,1));

    return viewer.run();




The problem is that the software doesn't show the node in execution but if i 
load the model before, without the button callback, the software shows the node.

Why?




Thank you!

Cheers,
Cosimo[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32107#32107





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to