Hi Werner,
The changes are to complex to be visualized by using the old Geode and doing
transforms and vertex manipulations.
I don't think the changes are too complex... Why can't you just resize
the vertex/normal/... arrays, and fill them with the new data? To be
precise: all you would change in your code is not create new
Geode/Geometry, and not replace any scene graph nodes - the filling of
vertex/normal/... arrays would be left the same as it is now.
For example:
//... constructor
m_geode = new osg::Geode;
m_geometry = new osg::Geometry;
m_geode->addDrawable(m_geometry.get());
m_vertexArray = new osg::Vec3Array; // initially empty
m_geometry->setVertexArray(m_vertexArray.get());
// same for other arrays
// set up render state etc.
m_geometry->setUseDisplayList(false);
m_geometry->setDataVariance(osg::Object::DYNAMIC);
//... per-frame update (update callback for example)
if (m_vertexArray->size() < number_of_vertices_we_need)
{
m_vertexArray->resize(number_of_vertices_we_need);
}
// same for other arrays
// copy vertex, normal and other data
// add/modify primitive sets if needed
We do this for other things (dynamic terrain, cable display) and it
works well as long as you flag your osg::Geometry object as DYNAMIC.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org