[osg-users] double vs. float precision in camera position + osg::MatrixTransform question
Roni Rosenzweig
roniros at gmail.com
Sun Mar 2 23:49:31 PST 2008
Hello
I made a small demo using osg 2.2, of an object moving on a terrain with a
camera looking at it from above, and lowering towards it.
When the location of the object+camera is near the (0,0,0) the demo works
smoothly.
However when their location is far (for example at location (30000, 5000,
100)), there are "vibrations" in the move of both the camera and the object.
I narrowed it down to a precision problem between float and double, and made
it much better using Vec3d/Matrixd instead of Vec3f/Matrixf for the camera
position.
However for the object I'm using a osg::MatrixTransform, which uses a Matrix
and not a Matrixd. I think this is causing the precision problems in the
object movement.
Did anyone else bump into this problem?
Is there a version of osg::MatrixTransform using a Matrixd for double
precision?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080303/662110c1/attachment.htm
More information about the osg-users
mailing list