It’s all about how you see it. Choose the layout you feel most comfortable with, but make sure you create your matrix library thereafter.
For example, a translation matrix in OpenGL looks like this,
1 0 0 x
0 1 0 y
0 0 1 z
0 0 0 1
where the elements are indexed like this,
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
As you can see, translation is located at 13-15. Now, if you use the transposed version of that translation matrix (x, y and z to the left in the bottom row), you must also transpose the index layout, making translation still located at index 13-15.
A matrix in OpenGL is a one sequence of 16 elements mapped in a cetrain way (for example, 13-15 for translation). How YOU translate this into a 2D layout is up to you.
What still confuses me is the following.
Look at the Matrix layout, like you posted it. If you want to access the translation part via the array index you have to use 3, 7 and 11 as index for elements 13, 14 and 15.
So I think how I do it, it is more straight forward (I can use element - 1 as index), or did I overlook something here?
Look at the Matrix layout, like you posted it. If you want to access the translation part via the array index you have to use 3, 7 and 11 as index for elements 13, 14 and 15.
Huh? You use index 12, 13 and 14 to access the translation part in my matrix. Subtract one from all numbers in my matrix and you have the offset in the array.