Chapter 2. A 3D/Math Primer

This chapter is an introduction to the mathematics behind 3D graphics. And in the immortal words of Douglas Adams (of Hitchhiker’s Guide to the Galaxy), “DON’T PANIC!” We discuss vectors, matrices, coordinate systems, transformations, and the DirectX Math library. Even if linear algebra is old hat to you, we encourage you to review the material specific to DirectX. Otherwise, take a deep breath, hold on, and don’t forget your towel.


You might recall the definitions of scalars and vectors from your high school physics class. Scalars are quantities with just a magnitude (a numerical value); vectors are quantities described by both magnitude and direction. Vectors wear multiple hats in 3D graphics—they describe ...

Get Real-Time 3D Rendering with DirectX® and HLSL: A Practical Guide to Graphics Programming now with O’Reilly online learning.

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