Is there an easy to way to do this job?  And, the code link on 
http://www.openscenegraph.org/documentation/NPSTutorials/osgUpdate.htm
  is broken now.

"Adrian Egli OpenSceneGraph (3D)" <[EMAIL PROTECTED]> 写道:
  Sorry for the empty email i sent :-( 

so the problem is that osg runs normally as a mulit threaded application. when 
you modify the scenegraph or it's behaviour you should do this in a secure way. 
there is a update callback in osg core. there you should add a update callback 
and in it's code you can add your code to get exectued. means the scene graph 
update has to be protected. in an other thread you can precalculate the next 
outlook of you data, the datas to update. 

http://www.openscenegraph.org/documentation/NPSTutorials/osgUpdate.htm

/adegli

  2008/1/28, Ronald Pan <[EMAIL PROTECTED]>:   I met the same problem of 
Stephan Maximilian Huber. My scenegraph is very
dynamic, lots of geometries get added, recomputed or removed. How to modify the 
scenegraph to avoid crash after the viewer runs?
I have set DataVariance to DYNAMIC. My code Crashes too. I am using VC and 
WinForm.
void OSGForm::AddSceneData(osg::ref_ptr<osg::Group> mModel)
{
 // Add the model to the scene
    mRoot->addChild(mModel.get());
 // Set the Scene Data
    mViewer->setSceneData(mRoot.get());
    // Realize the Viewer
    mViewer->realize();
}
 
void OSGForm::Render(void* ptr)
{
    OSGForm* osg = (OSGForm*)ptr;
    osgViewer::Viewer* viewer = osg->getViewer();
    while(!viewer->done())
    {
        viewer->fr
ame();
    }
    _endthread();
}
  
  
---------------------------------
  雅虎邮箱传递新年祝福,个性贺卡送亲朋!   

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





-- 
********************************************
Adrian Egli _______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


       
---------------------------------
雅虎邮箱传递新年祝福,个性贺卡送亲朋! 
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to