[osg-users] modifying vertexs

Jim Brooks jimblist at gmail.com
Fri Mar 6 07:21:59 PST 2009


.................................
osg::ref_ptr<osg::Vec3Array>  mVertexs;
mDrawArray = new osg::DrawArrays(osg::PrimitiveSet::POINTS,0,0);

// Modify vertex array (mVertexs is in app side).
mVertexs->push_back( vertex );

// Tell OSG geometry was modified.
mGeometry->setVertexArray( mVertexs.get() );
mGeometry->dirtyDisplayList();
mDrawArray->setCount( mVertexs->size() );
.................................

Nevermind.

So this code is doing a component-by-component update
after vertexs were modified.  This is correct afterall.

Was wondering why OSG has no higher-level osg::Geometry::dirty().
But since Geometry is composed of PrimitiveSets/DrawArrays
with APP-DEFINED indexs/count into the vertex array,
of course the app (not OSG) has to update components.



More information about the osg-users mailing list