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.

Vectors

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 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.