Why does OpenGL store the transpose instead of non-transpose?
Here is my way of thinking :
It is greater to manipulate a matrix with a one-dimensionnal array instead of a two dimensionnal : it allows you to reduce the cost of calculation in order to access an element. Thus matrices and vectors are only one-dimensionnal arrays. In this case it is more convenient to think with a row-vector representation. Moreover, in order to easily access basis vectors of a matrix, you have to store column vector linearly(for a column-vector representation : mathematical way (mostly)).
So it is more convenient to transpose the original matrix in order to be mathematically correct.
That's why :
Mathematical manner:
| 1 0 0 0 | |x| | x || 0 1 0 0 | |y| | y || 0 0 0 -1 | * |z| = | -1 || 0 0 1/focus 0 | |1| | z/focus |
OpenGL manner:
| 1 0 0 0 | | 0 1 0 0 || x y z 1| * | 0 0 0 1/focus | = | x y -1 z/focus | | 0 0 -1 0 |
One more thing : t(tB * tA) = A * B (A,B are matrices ; t is transpose)
[edited by - bloodscourge on April 5, 2002 4:04:16 PM]
I know that I don't know nothing... Operation Ivy