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();
> }
>
> ------------------------------
> 雅虎邮箱传递新年祝福,个性贺卡送亲朋!<http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline>
>
>
> _______________________________________________
> 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

Reply via email to