24.3. Matrices in graphics

Attitude

Now let’s take a more detailed look at the Matrix Multiply step of the graphics pipeline. We’ll discuss the more general three-dimensional case.

In the Matrix Multiply step we right-multiply our input vertices by a series of three matrices, first the model matrix, second the view matrix, and third the projection matrix. Although we list the matrices from left to right in our formulas, and in fact feed them into the graphics pipeline in the left-to-right order, the matrices act on the vertices in the reverse right-to-left order. In other words, the matrix closest to the vertex in the ordering of the formula acts on the vertex first.

The model matrix is frequently just the cMatrix _attitude member of the ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.