Hi Mike,

2014-11-04 8:22 GMT+01:00 Mike Connell <[email protected]>:
> 1 Read your data into a Vec3Darray - as doubles
> 2 Decide upon a local origin - "best" may be the centroid of your data, but
> the first point is somewhat quicker to find.
> 3 Subtract the local origin from all the points in your array - they are now
> still doubles, but each is a much smaller number which can be accurately
> represented by a float
> 4 Build a osg::Geometry with a Vec3Array for vertices, using your translated
> points
> 5 Put the Geometry under an osg::MatrixTransform, set the MT translation to
> your local origin
> return the MT

OK, now I understand.

> You *can* keep the original Vec3DArray if you want, but you probably don't
> need to, you'd have to compare the values there against the values of (local
> origin+p) to see if the difference is a problem for you, I doubt it will be.

Indeed, I think that I can safely discard the double precision data
once reduced in floats and decorated by the MatrixTransform.
Furthermore this approach has the advantage of keeping only one vertex
array "copy" in memory.

Many thanks for the clarification,

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

Reply via email to