GLSL rotate functions were incorrectly transposed.
I took the opportunity to optimise both the GLSL and HLSL versions.
For reference the rotation matrices are (Source: Wikipedia):
I think I got it all right, but @patriciogonzalezvivo please feel free to double-check.
GLSL rotate functions were incorrectly transposed. I took the opportunity to optimise both the GLSL and HLSL versions. For reference the rotation matrices are (Source: Wikipedia): I think I got it all right, but @patriciogonzalezvivo please feel free to double-check.
2D
$$R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \ \sin\theta & \cos\theta \end{bmatrix}$$
3D
$$\begin{bmatrix} 1 & 0 & 0 \ 0 & \cos\theta & -\sin\theta \ 0 & \sin\theta & \cos\theta \end{bmatrix}_x$$
$$\begin{bmatrix} \cos\theta & 0 & \sin\theta \ 0 & 1 & 0 \ -\sin\theta & 0 & \cos\theta \end{bmatrix}_y$$
$$\begin{bmatrix} \cos\theta & -\sin\theta & 0 \ \sin\theta & \cos\theta & 0 \ 0 & 0 & 1 \end{bmatrix}_z$$
Axis-angle
(sorry, too lazy to type this in Latex)
GLSL Constructors
GLSL matrices constructors are column-major.
HLSL Constructors
HLSL matrices constructors are row-major.