rounding the values isn't quite correct because the rotation components are related. 
the get() method (if you look at the documenation) performs a normalization of the 
matrix before putting the 3x3 values into the parameter.

sean


> -----Original Message-----
> From: Josh Richmond [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 19, 2002 11:23 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] Matrix4d bug!
> 
> 
> It is still the right type, but in the original 4x4 matrix we 
> have (rounded for ease of viewing)
> 
> 1 0 0
> 0 1 0
> 0 0 1
> 
> and in the 3x3 matrix (which was extracted via get) we have:
> 
> 0 1 0 
> 1 0 0
> 0 0 1
> 
> which is most definitely not the same transformation.
> 
> Am I just thinking incorrectly about this?
> 
> josh
> 
> >>> Kelvin Chung <[EMAIL PROTECTED]> 09/19/02 02:18PM >>>
> 
> 
> Josh Richmond wrote:
> > Hi everyone,
> > 
> > Either I misunderstand the definition of 
> Matrix4d.get(Matrix3d) or I've discovered a surprising bug.
> > 
> > Run the attached program to see, but it looks like (at 
> least using my initial values), the 3x3 matrix returned is 
> not the 3x3 rotation matrix of the 4x4 matrix, even with no 
> affine transformation.
> > 
> > E:\temp>java -cp . MatrixTest
> > 4x4:
> > 0.996823, 0.036243, 0.070927, -0.245034
> > -0.036412, 0.997481, 0.001096, 0.034035
> > -0.07084, -0.003675, 0.999336, 0.036529
> > 0.0, 0.0, 0.0, 1.0
> > 
> > 
> > 3x3:
> > 0.03627668530489642, 0.9968262981253496, 0.07086136795886099
> > 0.9993350269113018, -0.03644589019989963, 0.0010959360038394175
> > -0.0036750634657327997, -0.0707744901306144, 0.997485571552428
> > 
> > As you can see it is vastly re-arranged. Am I 
> misinterpreting the definition of the method? Is the problem 
> with my values? They're practically identity.
> > 
> > josh
> > 
> 
> 
> I don't see a problem here, if you pass the m3 matrix to 
> Transform3D and
> get its type :
>       
>         Transform3D t = new Transform3D();
>         t.set(m3);
>         int type = t.getType();
>       
>          if ((type & Transform3D.ZERO)                 > 0 ) 
> System.out.print(" ZERO");
>         if ((type & Transform3D.IDENTITY)             > 0 ) 
> System.out.print(" 
> IDENTITY");
>         if ((type & Transform3D.SCALE)                > 0 ) 
> System.out.print(" 
> SCALE");
>         if ((type & Transform3D.TRANSLATION)          > 0 ) 
> System.out.print(" 
> TRANSLATION");
>         if ((type & Transform3D.ORTHOGONAL)           > 0 ) 
> System.out.print(" 
> ORTHOGONAL");
>         if ((type & Transform3D.RIGID)                > 0 ) 
> System.out.print(" 
> RIGID");
>         if ((type & Transform3D.CONGRUENT)            > 0 ) 
> System.out.print(" 
> CONGRUENT");
>         if ((type & Transform3D.AFFINE)               > 0 ) 
> System.out.print(" 
> AFFINE");
>         if ((type & Transform3D.NEGATIVE_DETERMINANT) > 0 ) 
> System.out.print(" 
> NEGATIVE_DETERMINANT");
> 
> 
> 
> The output is :
> 
> ORTHOGONAL RIGID CONGRUENT AFFINE NEGATIVE_DETERMINANT4x4
> 
> 
> - Kelvin
> 
> =========================
> 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".
> 

==========================================================================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