At 09:46 AM 11/29/99 -0800, Doug Gehringer wrote:
>> can someone point me to the formula such that:
>> given the 4 by 4 transform matrix, it calculates
>> the translation(x, y, z), rotation(x, y, z) and
>> the scale factor(x, y, z)?
>
>If you just want to get these values, see the Transform3D get() methods.
>These
>will return the scale, translation and quanternion rotation for a Transform.

The rotation quaternion sometimes isn't exactly what you need.

I wanted to know the actual x, y, and z-axis rotations.  You can do this
with a bit of work: the following gets you the y-axis; I wanted it in
degrees for a heads-up "bearing" readout, amazing how humans don't think
in radians :)

  Matrix3d mMatrix = new Matrix3d();
  static final double sDegree = Math.PI / 180.0;
  Vector3d mTranslation = new Vector3d();

      mTG.getTransform(mTransform);
      mTransform.get(mMatrix);
      double theta = Math.atan2(mMatrix.m02, mMatrix.m00) / sDegree;

      // This will get you the range -Pi to +Pi

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