Some quick notes on rotations:

Rotate about an object centroid

If you want to rotate an object about its center:

  1. Translate object centroid to origin
  2. Rotate object
  3. Invert centroid translation

Rotate about arbitrary axis

If you want to rotate around an arbitrary axis:

  1. Make basis with desired rotation axis as \( \mathbf{w} \)
  2. Apply basis (z and rotation axis are now aligned)
  3. Rotate around z
  4. Apply inverse basis transform