Chapter 2

All That Math Jazz

No book on 3D programming would be complete without at least one chapter on the mathematics behind 3D transformations. If you care nothing about this, move on—there's nothing to see here. After all, doesn't OpenGL take care of this stuff automatically? Certainly. But it is helpful to be familiar with what's going on inside, if only to understand the lingo of 3D-speak.

Let's define some terminology first:

  • Translation: Moving an object from its initial position (see Figure 2-1, left)
  • Rotation: Rotating an object around a central point of origin (see Figure 2-1, right)
  • Scaling: Changing the size of an object
  • Transformation: All of the above

Figure 2-1. Translation (left) and rotation (right)

2D Transformations ...

Get Pro OpenGL ES for iOS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.