View Full Version : getting a matrix
blender
08-26-2002, 03:41 AM
How can I get a matrix from opengl and store it in an array like float m[16]?
I know I could use matrix pushing and popping but it would be more handy to store the into an array and load later on.
Deiussum
08-26-2002, 04:32 AM
float array[16];
glGetFloatv(GL_MODELVIEW_MATRIX, array);
Morglum
08-26-2002, 04:33 AM
float matrix [16];
glGetFloatfv (GL_MODELVIEW_MATRIX, matrix);
and remember that opengl stores matrix in a column-dominant order, that is :
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
--Morglum
Morglum
08-26-2002, 04:34 AM
oops, we posted exactly at the same time, Deiussum !
blender
08-26-2002, 06:30 AM
Thanks.
Arath
08-26-2002, 07:25 AM
You can also use the extension GL_ARB_transpose_matrix if you have matrix in math format (line, row)
Arath
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.