Hi!

You are right, the changes are minor and I'll follow your suggestion.

Thanks.

- Werner -

On Thursday 16 September 2010 17:53:41 Jean-Sébastien Guay wrote:
> 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

-- 
TEXION Software Solutions

TEXION GmbH -  Rotter Bruch 26a  -  D 52068 Aachen - HRB 14999 Aachen
Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu

Geschäftsführer/Managing Director: Werner Modenbach
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to