Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read the values from a glm::mat4

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??

like image 481
Edvin Avatar asked Sep 19 '13 08:09

Edvin


1 Answers

glm::mat4 pMat4;  // your matrix

double dArray[16] = {0.0};

const float *pSource = (const float*)glm::value_ptr(pMat4);
for (int i = 0; i < 16; ++i)
    dArray[i] = pSource[i];
like image 118
Roger Rowland Avatar answered Nov 14 '22 08:11

Roger Rowland