Hi Robert,

2014-10-31 14:50 GMT+01:00 Robert Osfield <[email protected]>:
> If you really do need to handle double data then the best way is to load it
> in doubles then post process the loaded subgraph to convert the double data
> to floats in the way that is appropriate for that data - such as decorating
> subgraphs with MatrixTransform and convert the osg::Geometry's Vec3dArray in
> world coords to a Vec3Array in local coordinates.

Well, this is where I'm lost ;-)

Say I'm loading my data as double. My reader will thus store these
data as Vec3dArray in the osg::Geometry::_vertexArray member variable
of the geometry attached to the returned osg::Node.

Now, I need to transform these double data as float for rendering. So,
you create an osg::MatrixTransform node, attach it the osg::Node
returned by the reader and create yet another osg::Node, also attached
to the same osg::MatrixTransform node, but with an
osg::Geometry::_vertexArray containing the data as float in a
Vec3Array?

Or is there only one osg::Node (the one returned by the loader, still
attached to an osg::MatrixTransform node) with two vertex arrays: the
osg::Geometry::_vertexArray member variable with the data as float for
rendering, and yet another Vec3dArray with the data as double, stored
as osg::Node's UserDataContainer (since an osg::Geometry can't hold
two vertex arrays)?

> If you want good rendering performance you'll need to convert to float
> arrays at somepoint so after loaded is typically the best time.

I'm OK with this, this is how the conversion procedure takes place
that puzzles me.

     Émeric
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to