[osg-users] Updating scene properties instead of recreating it each frame

Maxim Stere osgforum at tevs.eu
Mon Jul 2 06:59:51 PDT 2018

Hi OmegaDoom,

When you do:
geometry.setVertexArray(&vertices); you are not actually updating anything,
you are replacing the vertex array. So you are still doing deallocation and allocation. 

If you want to just update them, I would say do what you were doing, do what Andreas said, and...
osg::Vec3Array& vertices = static_cast<osg::Vec3Array&>(*geometry.getVertexArray());
But instead of clearing them, you need to change the values in the "vertices" to the new values they should be.

Thank you,

Read this topic online here:

More information about the osg-users mailing list