Hi Peter,

   Bug 4428412 is submit for this. You can workaround this
by setting the rotation matrix to Quat4f first and then
use the result to set AxisAngle4f as shown:

import javax.vecmath.*;

public class TestAxisAngle
{
  public static void main(String []args)
  {
    Matrix3d rotation = new Matrix3d();
    rotation.rotX(Math.PI);

    Quat4f quat = new Quat4f();
    quat.set(rotation);

    AxisAngle4f orientation = new AxisAngle4f();
    orientation.set( quat );

    System.out.println( "Rotation=" + rotation.toString() );
    System.out.println( "Orientation=" + orientation.toString() );
  }
}

Thanks for your bug report.

- Kelvin
------------
Java 3D Team
Sun Microsystems Inc.


>X-Unix-From: [EMAIL PROTECTED]  Wed Mar 21 08:23:14 2001
>MIME-Version: 1.0
>Date: Wed, 21 Mar 2001 15:57:44 -0000
>From: Peter Balmforth <[EMAIL PROTECTED]>
>Subject: [JAVA3D] AxisAngle.set(Matrix3d) incorrect for rotation of PI
>To: [EMAIL PROTECTED]
>
>AxisAngle4f.set(Matrix3d) sets the wrong values when the rotation
>is PI about the Y axis. I think it will occur with some of the
>similar combinations of classes as well.
>
>The following bit of code demonstrates it. Because the
>rotation is PI the method assumes it is an identity matrix
>and defaults the axis angle to (0.0,1.0,0.0,0.0) when it should be
>(0.0,1.0,0.0,3.1459).
>
>import javax.vecmath.*;
>
>public class TestAxisAngle
>{
>  public static void main(String []args)
>  {
>    Matrix3d rotation = new Matrix3d();
>    rotation.rotY(Math.PI);
>
>    AxisAngle4f orientation = new AxisAngle4f();
>    orientation.set( rotation );
>
>    System.out.println( "Rotation=" + rotation.toString() );
>    System.out.println( "Orientation=" + orientation.toString() );
>  }
>}
>
>===========================================================================
>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