In some rendering APIs there is a world (or model) matrix and a viewing matrix. In OpenGL, howeverm there is a modelview matrix. I know this is a result of some sort of concatenation, but how is this made? If the two matrices are multiplied, is it MODEL * VIEW or VIEW * MODEL?
Well in OpenGL you would first do a glLoadMatrix(view) and then a glMultMatrix(model). Whether this is view * model or model * view depends on how you interpret the 16 float's that OpenGL uses for a matrix. If you think of 0,1,2,3 as the first COLUMN of a matrix, then the procedure above is equivalent to: view * model. If you think of 0,1,2,3 as the first ROW of a matrix, then it would be model * view. Why? Well (A * B)T = BT * AT, or in English: the transpose of a matrix multiplication is the multiplication of the transposed matrices in reverse order.
Does that make any sense?
Edited by - Scarab0 on November 7, 2001 10:41:55 AM