I have the following code snippet that works below. Long story short, I need to convert a 4x4 matrix which is a double value to a float based 4x4 value which OpenGL will accept.
Is there a better way to write what is written below or is this the best and fastest way?
/*
pGlobalPosition is a double 4x4 Matrix exported from an SDK
*/
pGlobalPosition
/*
I am trying to put the value in an equivalent matrix
that is acceptable and fast to OpenGL.
*/
GLfloat fGlobalPosition[16];
fGlobalPosition[0] = (float)pGlobalPosition[0][0];
fGlobalPosition[1] = (float)pGlobalPosition[1][0];
fGlobalPosition[2] = (float)pGlobalPosition[2][0];
fGlobalPosition[3] = (float)pGlobalPosition[3][0];
fGlobalPosition[4] = (float)pGlobalPosition[0][1];
fGlobalPosition[5] = (float)pGlobalPosition[1][1];
fGlobalPosition[6] = (float)pGlobalPosition[2][1];
fGlobalPosition[7] = (float)pGlobalPosition[3][1];
fGlobalPosition[8] = (float)pGlobalPosition[0][2];
fGlobalPosition[9] = (float)pGlobalPosition[1][2];
fGlobalPosition[10] = (float)pGlobalPosition[2][2];
fGlobalPosition[11] = (float)pGlobalPosition[3][2];
fGlobalPosition[12] = (float)pGlobalPosition[0][3];
fGlobalPosition[13] = (float)pGlobalPosition[1][3];
fGlobalPosition[14] = (float)pGlobalPosition[2][3];
fGlobalPosition[15] = (float)pGlobalPosition[3][3];