I want to perform an combined rotation in a fixed coordination system.
If you rotate an object around X using a transformation matrix, the object's
coord-system also rotates. A second performed rotation around Y or Z will
rotate around Y' or Z', the new axes. This is called nested rotation (e.g.
flight simulators).

To perform non-nested rotations, i.e. rotation in a fixed coordination
system, you have to recalculate the old Z axis.
i do it like this:

*get the rotation matrix component of the X- rotation.
*invert the matrix (a inverted matrix would do the same rotation in the
  opposit direction)
*get the Z-Column (this is the old Z-axis in terms of the new coordination
   system)
*rotate around Z-Column

For the 2. rotation I use setRotation(AxisAngle4d). It works fine when I
make rotations divisible through PI/2 (90�).
Rotations like PI/4 don't behave like they should. This is the reason why I
suspect that setRotation(AxisAngle4d) doesn't work well.

can anyone help me please with this problem? Thank you.
roland kofler

related code fragment:

rotationX.rotX(_rot.x);
// rotate about X

transrotation.mul(rotationX);

// rotate about Y
if (_rot.y != 0) {
         rotationY = new Transform3D();
         rotationX.get(e_);
         e_.invert();
         e_.normalize();
         e_.getColumn(1,help);
         System.out.println(" {e_ (.)(1)} :"+help.toString());
         e_Achse = new AxisAngle4d(help, (1.0d)*_rot.y);
         rotationY.setRotation(e_Achse);
         transrotation.mul(rotationY);
}


// rotate about Z

if (_rot.z != 0 ){
         rotationZ = new Transform3D(transrotation);
         rotationZ.get(e_);
         e_.invert();
         e_.getColumn(2,help);
         System.out.println(" {e_ (.)(2)} :"+ help.toString());
         e_Achse = new AxisAngle4d(help, (1.0d)*_rot.z);
         rotationZ.setIdentity();
         rotationZ.setRotation(e_Achse);
         transrotation.mul(rotationZ);
}

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