Game Development Reference
In-Depth Information
Actually, now would be a good time to warn you that a lot of people take
a much firmer stance on this issue and would not approve of our cavalier
attitude in treating vectors and points as mathematical equals. 4 Such hard-
liners will tell you, for example, that while you can add two vectors (yielding
a third vector), and you can add a vector and a point (yielding a point),
you cannot add two points together. We admit that there is some value
in understanding these distinctions in certain circumstances. However, we
have found that, especially when writing code that operates on points and
vectors, adherence to these ethics results in programs that are almost always
longer and never faster. 5 Whether it makes the code cleaner or easier to
understand is a highly subjective matter. Although this topic does not use
different notations for points and vectors, in general it will be clear whether
a quantity is a point or a vector. We have tried to avoid presenting results
with vectors and points mixed inappropriately, but for all the intermediate
steps, we might not have been quite as scrupulous.
2.4.3 It's All Relative
Before we move on to the vector operations, let's take a brief philosoph-
ical intermission. Spatial position is not the only aspect of our world for
which we have di culty establishing an “absolute” reference, and so we use
relative measurements. There are also temperature, loudness, and velocity.
Temperature. One of the first attempts to make a standard temperature
scale occurred about AD 170, when Galen proposed a standard “neutral”
temperature made up of equal quantities of boiling water and ice. On either
side of this temperature were four degrees of “hotter” and four degrees
of “colder.” Sounds fairly primitive, right? In 1724, Gabriel Fahrenheit
suggested a bit more precise system. He suggested that mercury be used
as the liquid in a thermometer, and calibrated his scale using two reference
points: the freezing point of water, and the temperature of a healthy human
being. He called his scale the Fahrenheit scale, and measurements were in
o F. In 1745, Carolus Linnaeus of Uppsala, Sweden, suggested that things
would be simpler if we made the scale range from 0 (at the freezing point
of water) to 100 (water's boiling point), and called this scale the centigrade
scale. (This scale was later abandoned in favor of the Celsius scale, which is
technically different from centigrade in subtle ways that are not important
here.) Notice that all of these scales are relative—they are based on the
freezing point of water, which is an arbitrary (but highly practical) reference
point. A temperature reading of x o C basically means “x degrees hotter
than the temperature at which water freezes.” It wasn't until 1848, with
4 If you are one of those people, then this is a warning of a slightly different sort!
5 Indeed, sometimes slower, depending on your compiler.
Search WWH ::




Custom Search