2D? 3D? What Are You Talking About?

Before you can dive into the wonderful world of 3D math, you need at least a basic understanding of the differences between a 2D world and a 3D world. Grab a piece of paper and a pencil. Draw something on the piece of paper, and look at it. It is an example of a basic 2D world. The image you drew has two different dimensions, width and height. Now, look at this book you're holding. You'll notice that it too has width and height, but it also has an “added” dimension, namely depth. Each page of the book is essentially flat, but the book itself has depth.

In the 2D world, any point in space can be defined by a coordinate that represents the width and height of that point. You have an x axis (which is the width ...

Get Beginning 3D Game 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.