So far I’ve been happy with just seting the Translation and Rotation of an TransformGroup which holds my 3d model(s).
Now I’d like to find out the Translation or Rotation separately.
So let’s fetch the Transform3D object:
Transform3D tf = myTransformGroup.getTransform();
Getting the translation is easy:
Vector3f translation = new Vector3f();
tf.getTranslation(translation);
Then the translation vector neatly shows the x-/y-/z- values of the translation.
Getting the rotation isn’t so easy: you “just” get a matrix:
Matrix3f m = new Matrix3f();
tf.getRotation(m);
Since I set the rotation of the model with three angle values of the three axes via tf.rotX(xdegree), tf.rotY(ydegree), tf.rotZ(zdegree), I’d like to get these values back, too.
How to extract them out of the matrix, please?