Chapter 3Vector Geometry

Much, if not most, of the graphics pipeline relies on asking geometric questions about objects in a scene. At the modeling stage, it is helpful to know where the middle of a face is or whether four vertices lie in a plane. If we think of light as traveling in rays, then asking where a ray intersects an object is key to understanding the shade of the object and the shadow it casts. The task now is to take the notion of a vector and use it as efficiently as possible to make geometric calculations. The goal is threefold: express the calculations simply so that producing an algorithm is relatively easy, make the calculations general so that the algorithms are easily extended, and keep an eye on the number of elementary arithmetic operations in each larger calculation so that the resulting computer code runs quickly.

Vectors fit Euclidean geometry particularly well, which means that linear structures such as lines and planes along with circular structures (with fixed radii) are the focus of attention. We certainly want to eventually extend our reach to more organic shapes, so we look for ways that vector calculations change our perspective in describing nonlinear forms.

3.1 Lines and Planes

3.1.1 Vector Description of Lines

One way to describe a line is to say it contains two particular points, say c03-math-0001 and . This allows us to construct the line (actually draw ...

Get Mathematical Structures for Computer Graphics 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.