I think Robert means its NOT recommend below :) Best Regards
Gordon __________________________________________________________ Gordon Tomlinson "Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival" - Master Tambo Tetsura -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Robert Osfield Sent: Monday, May 21, 2007 7:21 AM To: osg users Subject: Re: [osg-users] Program design issue Hi Martin, Adding and removing nodes/drawables during any traversal can invalidate iterators held by calling functions so its recommend, its best to do this outside an update callback. W.r.t adding/removing nodes, perhaps you can just switch nodes on/off using Node masks or a Switch node. Robert. On 5/21/07, Martin Weier <[EMAIL PROTECTED]> wrote: > Since I am new to OSG I need some help for my program and some hints on > where to start. The application needs to be able to add and remove > geodes from the scenegraph dynamically each frame. For this I want to > provide a queue of textures and primitives. that is update each frame > based on the current camera-/view-frustrum position. To do so the queue > will be entirely removed and than refilled. Than all old geodes should > be remove and the new ones should be added. In my first version I tried > creating a group node and attached a update callback to it. During the > callback step I tried to remove all nodes from the scenegraph but this > call causes the program to crash. Since I am assuming that I can remove > all elements of this group node during update and add new ones, I think > that this crash is based on some pointer-/memory issues in my code. The > Debugger outputs free(): invalid pointer. Even though everything seems > to work fine when I remove everything expect the first. > However I am not sure if this is an efficient and the right way to do > this. So a basic description, websites, example source code or a short > statement on how to to all of the above would be very helpful > I would really appreciate some help.. > > Martin > _______________________________________________ > 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/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
