I have a glm::mat4 matrix and I need to get the values into a double[16] array. Any ideas on how to solve this problem??
2 Answers
26
votes
0
votes
&mat[0][0]
also will work. From the OpenGL Interoperability section in glm documentation:
glm::vec4 v(0.0f);
glm::mat4 m(1.0f);
...
glUniform3fv(uniVec, 1, glm::value_ptr(&v[0]));
glUniformMatrix4fv(uniMat, 1, GL_FALSE, &m[0][0]);