.................................
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.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to