[osg-users] How to add some new nodes at runtime

Chris 'Xenon' Hanson xenon at alphapixel.com
Sat Apr 9 15:36:50 PDT 2011


On 4/9/2011 11:01 AM, Glatheas Númenor wrote:
> Hi,
> I would like to add some new nodes into scene graph during runtime. Is it possible somehow?

  Do this during the update phase.

  It' usually not safe to do this while any traversal (like update) is running, as the
iterators used by the update visitor can break if you add/remove nodes.

  If you're using the run() method on the viewer, you will need to stop using that and
have a loop where you call frame() yourself for each frame, followed by performing the
steps necessary to add/remove data.

> Thanks
> Glatheas

-- 
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen



More information about the osg-users mailing list