OGL.Matrix[x][y] || [y][x]?

Started by
2 comments, last by Esap1 23 years, 10 months ago
In OpenGL, does a Matrix get called as Matrix[X][Y], or is it the other way around? for example: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 If I wanted the 1, would I get it by Matrix[1][3], or by Matrix[3][1]? Thanks for the help, later
Advertisement
OpenGL matricies are stored in column major order, so use matrix[col][row]. A OpenGL matrix for 16 values would look like this in memory.

0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15

Hope this helps.

Oops messed up.

Nate
http://nate.scuzzy.net


Edited by - Nate on June 25, 2000 11:58:46 PM
Standard mathematical rotation is M[r][c], OpenGL uses M[c][r] c = column, r = row

---
www.crazycrackerz.org
So D3D is Matrix[row][col], isn''t it?

This topic is closed to new replies.

Advertisement