Reputation: 1234
I have extracted the upper left 3x3 rotation matrice of a mat4:
glm::mat4 model;
glm::mat3 rot = glm::mat3(model);
Now I want the identity matrix with the upper left being my new mat3
What is the simplest way of doing so?
glm::mat4 result;
result[0] = glm::vec4(rot[0], 0);
result[1] = glm::vec4(rot[1], 0);
result[2] = glm::vec4(rot[2], 0);
result[3] = glm::vec4(0, 0, 0, 1);
Is there a better way?
Upvotes: 6
Views: 9609