Transforming Vertices

Vertex transformations (such as rotations, translations, scaling, and shearing) and projections (such as perspective and orthographic) can all be represented by applying an appropriate 4 × 4 matrix to the coordinates representing the vertex. If v represents a homogeneous vertex and M is a 4 × 4 transformation matrix, then Mv is the image of v under the transformation by M. (In computer-graphics applications, the transformations used are usually nonsingular—in other words, the matrix M can be inverted. This isn’t required, but some problems arise with singular matrices.)

After transformation, all transformed vertices are clipped so that x, y, and z are in the range [–w, w] (assuming w > 0). Note that this range corresponds ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition 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.