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. Mark Hood's "conditionScale" doesn't always work, many times AFFINE transforms are still AFFINE after running it.

Btw2. Rather strange Sun has removed bug 4751283 from the BugParade.
Does that mean they regard it as closed?





Regards
Nikolai


---------------------------------------------- Nikolai V. Christensen, Computer Engineer, Simulation and Training department IFAD, Forskerparken 10A, DK-5230 Odense M Denmark, EU Phone: +45 63 15 71 31 Fax: +45 65 93 29 99 WWWeb: http://www.ifad.dk e-mail: [EMAIL PROTECTED] ----------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to