Nikolai, It seems your test code shows an issue with the set() method of Transform3D rather than an issue with normalizeCP(). According to the javadoc for Transform3D, set() doesn't copy the scale:
public final void set(Transform3D t1) Sets the matrix, type, and state of this transform to the matrix, type, and state of transform t1. I checked it with JBuilder, and it does indeed do only what's advertised. I don't know if normalizeCP() does all of what it's supposed to do, but it appears not to change the scale, as the javadoc claims and your code shows. Chet Urata --- "Nikolai V. Chr." <[EMAIL PROTECTED]> wrote: > 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".