General Three dimensional Rotations

A rotation matrix for any axis that does not coincide with a coordinate axis can be set up as a composite transformation involving combination of translations and the coordinate-axes rotations.

  1. Translate the object so that the rotation axis passes through the coordinate origin

  2. Rotate the object so that the axis rotation coincides with one of the coordinate axes

  3. Perform the specified rotation about that coordinate axis

  4. Apply inverse rotation axis back to its original orientation

  5. Apply the inverse translation to bring the rotation axis back to its original position


In Java 3D no way to define directly a general rotation, but at least, it is possible to easily define a rotation around an axis that goes trough the origin