我有一个glm :: mat4矩阵,我需要将值转换为double [16]数组。关于如何解决这个问题的任何想法?
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];