import javax.media.j3d.;
import javax.vecmath.;
public class scaleTest {
public scaleTest () {
}
public static void main (String[] args) {
Transform3D t1 = new Transform3D();
Transform3D t2 = new Transform3D();
Vector3d s1 = new Vector3d(1.0,1.0,3.0);
Vector3d s2 = new Vector3d();
t1.set(new AxisAngle4d(0,1,0,1.57));
t1.setScale (s1);
t1.normalizeCP ();
t2.set(t1); // even if normalizeCP is flawed this should make t1==t2
t1.getScale (s1);
t2.getScale (s2);
System.out.println(s1+" == "+s2);
}
}
Expected Output:
(1.0, 1.0, 3.0) == (1.0, 1.0, 3.0)
Actual Output:
(1.0, 1.0, 3.0) == (2.9999991544849074, 1.0, 1.0000025365417038)
Why normalizeCP() is important when we have normalize():
Because normalize() also fails, see bug 4751283 “Transform3D.normalize()
and Matrix4d.get(Matrix3d) permute matrix columns.”:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0209&L=java3d-interest&D=0&I=-3&P=30861
So I am left with no working normalize method?
I will be grateful for any code suggestions able to cope with
non-uniform scales.
Btw. Rather strange Sun has removed bug 4751283 from the BugParade.
Does that mean they regard it as closed?