Chapter 2 The Cartesian Coordinate System
2.4 Exercises
1. Give the coordinates of the following points:
20
Chapter 2: The Cartesian Coordinate SystemFigure 2.16: The left-handed coordinate system conventions used in this book
2. List the 48 different possible ways that the 3D axes may be assigned to the directions “north,” “east,” and “up.” Identify which of these combinations are left-handed and which are right-handed.
3. In the popular modeling program 3D Studio Max, the default orientation of the axes is for +x to point right, +y to point forward, and +z to point up. Is this a left- or right-handed coordinate space?
C h a p t e r 3
Multiple Coordinate
Multiple Coordinate
Spaces
In Chapter 2, we discussed how we can establish a coordinate space anywhere we want simply by picking a point to be the origin and deciding on the directions we want the axes to be oriented. We usually don’t make these decisions arbitrarily; we form coordinate spaces for specific reasons (one might say “different spaces for different cases”). This chapter gives some examples of com- mon coordinate spaces that are used for graphics and games. We will then discuss how coordinate spaces are nested within other coordinate spaces.
23
This chapter introduces the idea of multiple coordinate systems. It is divided into five main sections.
n Section 3.1 justifies the need for multiple coordinate systems.
n Section 3.2 introduces some common coordinate systems. The main concepts intro- duced are:
u World space
u Object space
u Camera space
u Inertial space
n Section 3.3 discusses nested coordinate spaces, commonly used for animating hier- archically segmented objects in 3D space.
n Section 3.4 describes how to specify one coordinate system in terms of another.
n Section 3.5 describes coordinate space transformations. The main concepts are:
u Transforming between object space and inertial space
3.1 Why Multiple Coordinate Spaces?
Why do we need more than one coordinate space? After all, any one 3D coordinate system extends infinitely and thus contains all points in space. So we could just pick a coordinate space, declare it to be the “world” coordinate space, and all points could be located using this coordinate space. Wouldn’t that be easier? In practice, the answer to this is “no.” Most people find it more conve- nient to use different coordinate spaces in different situations.
The reason multiple coordinate spaces are used is that certain pieces of information are only known in the context of a particular reference frame. It is true that, theoretically, all points could be expressed using a single “world” coordinate system. However, for a certain point a, we may not know the coordinates of a in the “world” coordinate system. However, we may be able to express
a using some other coordinate system. For example, the residents of Cartesia (see Section 2.2.1)
use a map of their city with the origin centered, quite sensibly, at the center of town and the axes directed along the cardinal points of the compass. The residents of Dyslexia use a map of their city with the coordinates centered at an arbitrary point and the axes running in some arbitrary direction that probably seemed like a good idea at the time. The citizens of both cities are quite happy with their respective maps, but the State Transportation Engineer assigned the task of running up a bud- get for the first highway between Cartesia and Dyslexia needs a map showing the details of both cities, which introduces a third coordinate system that is superior to him, though not necessarily to anybody else. The major points on both maps need to be translated from the local coordinates of the respective city to the new coordinate system to make the new map.
The concept of multiple coordinate systems has historical precedent. While Aristotle (384-322 BCE), in his books On the Heavens and Physics, proposed a geocentric universe with the Earth at the origin, Aristarchus (ca. 310-230 BCE) proposed a heliocentric universe with the Sun at the origin. So we can see that more than two millennia ago the choice of coordinate system was already a hot topic for discussion. The issue wasn’t settled for another couple of millennia until Nicholas Copernicus (1473-1543) observed in his book De Revolutionibus Orbium
Coelestium (“On the Revolutions of the Celestial Orbs”) that the orbits of the planets can be
explained more simply in a heliocentric universe without all the mucking about with wheels within wheels in a geocentric universe. Of course, not everybody could appreciate the math, which is what got Galileo Galilei (1520-1591) in so much trouble during the Inquisition, since the church had reasons of its own (having little if anything to do with math) for believing in a geocen- tric universe.
In Sand-Reckoner, Archimedes (d. 212 BCE), perhaps motivated by some of the concepts introduced in Section 2.1, developed a notation for writing down very large numbers, numbers much larger than anybody had ever counted to at that time. Instead of choosing to count dead sheep as in Section 2.1, he chose to count the number of grains of sand that it would take to fill the universe. (He estimated that it would take 8x1063grains of sand, but he did not, however, address the question of where we would get the sand from.) In order to make the numbers larger, he chose Aristarchus’ revolutionary new heliocentric universe rather than the geocentric universe generally accepted at the time. In a heliocentric universe, the Earth orbits the Sun, in which case the fact that the stars show no parallax means that they must be much farther away than Aristotle could ever