- Take care, order of operation does matter !
-
- Rotation \(r\), Translation \(t\): \(\;\;r\circ t \neq t\circ r\) \(\;\;\Rightarrow\; \mathrm{M}_1= \mathrm{T}\,\mathrm{R} \;\neq\;
\mathrm{R}\,\mathrm{T} = \mathrm{M}_2\)
- Take care (2): transformation matrices applied to coordinates from right to left.
- \(\mathrm{M}_1=\mathrm{T}\mathrm{R}=\left(\begin{array}{c|c} 1 & t \\ \hline 0 & 1 \end{array}\right)\,\left(\begin{array}{c|c} R & 0 \\ \hline 0 & 1
\end{array}\right) = \left(\begin{array}{c|c} R & t \\ \hline 0 & 1 \end{array}\right)\)
- First rotates, then translates
- \(\mathrm{M}_2=\mathrm{R}\mathrm{T}=\left(\begin{array}{c|c} R & 0 \\ \hline 0 & 1 \end{array}\right)\,\left(\begin{array}{c|c} 1 & t \\ \hline 0 & 1
\end{array}\right) = \left(\begin{array}{c|c} R & \mathrm{R}\,t \\ \hline 0 & 1 \end{array}\right)\)
- First translates, then rotates
-
- Rotation always happens around the origin.
Beware: Some libraries (old OpenGL, Three.js) apply transformation from "left to right" using transposed matrix multiplication