Chapter 4. Math for 3D Graphics

What You’ll Learn in This Chapter

• What a vector is, and why you should care

• What a matrix is, and why you should care more

• How we use matrices and vectors to move geometry around

• The OpenGL conventions and coordinate spaces

So far, you have learned to draw points, lines, and triangles and have written simple shaders that pass your hard-coded vertex data through unmodified. We haven’t really been rendering in 3D—which is odd for a book on 3D graphics! Well, to turn a collection of shapes into a coherent scene, you must arrange them in relation to one another and to the viewer. In this chapter, you start moving shapes and objects around in your coordinate system. The ability to place and orient your objects ...

Get OpenGL® SuperBible: Comprehensive Tutorial and Reference, Sixth Edition now with the O’Reilly learning platform.

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