|
![](/i/fill.gif) |
> Ok, so it was the Java3D package that used single precision floats ?
Sort of... I don't know if it can be considered as a bug: The double
precision 4x4 matrix class (Matrix4d) has a setRotationScale() method
that takes a Quaternion as argument - either float (Quat4f) or double
(Quat4d). The thing is, if you use a float quaternion on the double
matrix, it seems that it does not re-normalize the quaternion after
conversion to doubles.
Now I do
public void setOrientation(Quat4f orient_float) {
Quat4d orient_double = new Quat4d(orient_float);
orient_double.normalize();
matrix.setRotation(orient_double);
}
which fixes the problem...
I'm not sure if Sun's official J3D package has the same problems - I'm
using it in an open source project and so I'm forced to use an
"inofficial" javax.vecmath package :-(
POV-Ray is happy with the new truly double-precision matrix, so I'm
happy too :-)
Thanks again,
-Sascha
Post a reply to this message
|
![](/i/fill.gif) |