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".