[osg-users] Direct VertexArray Modification

Nick Prudent valerianmusic at hotmail.com
Wed Sep 5 04:28:45 PDT 2007

Inside my render loop, I'm updating some geometry based on external events. When I change a transform (rotation + translate),  everything updates fines. However, if I change vertices directly, nothing happend. Is there a flag that I need to reset to force the system to recompute the render graph?

Here's the code I use:

   // Get vertex array
    osg::Vec3Array* pVertices = (osg::Vec3Array*)pGeometry->getVertexArray();
    if ( !pVertices )
    // Change vertices
    (*pVertices)[0].set( xMin,          yMax, depth );
    (*pVertices)[1].set( xMin,          yMin, depth );    	
    (*pVertices)[2].set( xMax_new, yMin, depth );
    (*pVertices)[3].set( xMax_new, yMax, depth );  

In fact, this only works the first time...No idea why...


- Nick -
Connect to the next generation of MSN Messenger 

More information about the osg-users mailing list