While messing around glm, I stumbled upon something I need clarification on. I have always knew that GLM and OpenGL followed column major notation. But when I print the matrix out, it looks like its in row major form.
#include <iostream>
#include <glm\glm.hpp>
#include <glm\gtc\matrix_transform.hpp>
#include <glm\gtx\string_cast.hpp>
using std::cout;
using std::endl;
int main()
{
glm::vec3 translate(3.0f, 4.0f, 4.0f);
glm::mat4 identity(1.0f);
glm::mat4 model = glm::translate(identity, translate);
cout << "[0][0]: " << model[0][0] << " [0][1]: " << model[0][1] << " [0][2]: " << model[0][2] << " [0][3]: " << model[0][3] << endl;
cout << "[1][0]: " << model[1][0] << " [1][1]: " << model[1][1] << " [1][2]: " << model[1][2] << " [1][3]: " << model[1][3] << endl;
cout << "[2][0]: " << model[2][0] << " [2][1]: " << model[2][1] << " [2][2]: " << model[2][2] << " [2][3]: " << model[2][3] << endl;
cout << "[3][0]: " << model[3][0] << " [3][1]: " << model[3][1] << " [3][2]: " << model[3][2] << " [3][3]: " << model[3][3] << endl;
cout << " " << endl;
cout << glm::to_string(model) << endl;
system("Pause");
return 0;
}
If you run the above code, the translation column is actually a translation row. This does not make sense, doesn't GLM follow column major. Shouldn't the translation be on [0][3], [1][3], [2][3], instead of [3][0], [3][1], [3][2].