| |||

Home > Developing OpenGL ES Applications > OpenGL ES limitations > Viewing transforms |

When computing your own viewing matrix, ensure you understand how OpenGL ES handles matrices.

When you multiply the position vector with several matrices to achieve transformations such as translation, rotation, scaling or projection, the effect when applying the resulting matrix on a position vector is as if the individual matrix multiplication operations were performed from right to left. This means that the usual sequence of matrices as defined by OpenGL is, from left to right:

Projection matrix

View matrix

Any number of model transformation matrices, from most global to most local.

You must then multiply the resulting matrix by the vertex position with the matrix on the left.

OpenGL ES assumes matrices are stored in column major order, however arrays in the C programming language are stored in row major order. This means that when you write matrices as constants, they appear transposed. This applies to constants in your application program in addition to shader programs. Figure 2.1 shows an example of a translation matrix.