This chapter covers
- Building a mental model for 3D vectors
- Doing 3D vector arithmetic
- Using the dot product and cross product to measure lengths and directions
- Rendering a 3D object in 2D
The 2D world is easy to visualize, but the real world has three dimensions. Whether we are using software to design a building, animate a movie, or run an action game, it needs to be aware of the three spatial dimensions in which we live.
In a two-dimensional space like a page of this book, we have a vertical and a horizontal direction. Adding a third dimension, we could also talk about points or arrows that lie outside of the page, either toward us or away from us. But, even when they simulate three dimensions, most computer displays are two-dimensional. Our mission in this chapter will be to build the tools we need to take 3D objects measured by 3D vectors and convert them to 2D so they can show up on the screen.
A sphere is one example of a 3D shape. A successfully drawn 3D sphere could look like this: