Closed JieX closed 8 years ago
So in the book source code the matrices are a 2-D array. In mesa, they are a 1-D array stored in column major order.
Mesa defines:
So, for example, M(1,3) would be m[3 * 4+1] or m[13]. In our matrices, m[3][1] would be in linear address m[3*4+1] which is the same thing.
I think what is throwing you for a loop is that the matrices are in column major order and the M macro is row,col and when you look at our code it is always [col][row].
After compared with mesa lib, i got confused with these matrixes. As the "frust" in esFrustum(), "result" in esTranslate() and esScale() are using the transpose of standard transform matrix, does "rotMat" in esRotate() should be the tranposed(as below)?
but the orignal "rotMat" in esRotate() works: