In
GLM, common methods for 4x4 matrices commonly used in OpenGL include:
glm::mat4
a = glm::mat4(1);glm::mat4
b = glm::translate(a,
glm::vec3(1,
0, 0));glm::mat4
c = glm::rotate(b,
0.0f, glm::vec3(0,
1, 0));glm::mat4
d = glm::scale(c,
glm::vec3(2,
1, 1));glm::mat4 e = glm::inverse(d);
The
modeling
matrix is initially set to the identity matrix.
In GLM, this can be achieved using:
glm::mat4 mModelMatrix = glm::mat4(1);