Game Development Reference
In-Depth Information
some given float3 from object space to “world space,” the translation
should occur.
What seems to be the norm in a lot of game code is to simply have
vector math details strewn about everywhere that multiplies by a rotation
matrix (or its inverse) and explicitly has (or does not have) a vector ad-
dition or subtraction, as appropriate. We advocate giving a name to this
intermediate space to differentiate it from “world space,” in order to facili-
tate code that uses human-readable words such as “object,” “upright,” and
“world,” rather than explicit math tokens such as “add,” “subtract,” and
“inverse.” It is our experience that this sort of code is easier to read and
write. We also hope this terminology will make this topic easier to read
as well! Decide for yourself if our terminology is of use to you, but please
make sure you read the rest of our small crusade for more human-readable
code in Section 8.2.1.
3.6
Exercises
(Answers on page 758.)
1. What coordinate space (object, upright, camera, or world) is the most
appropriate in which to ask the following questions?
(a) Is my computer in front of me or behind me?
(b) Is the topic east or west of me?
(c) How do I get from one room to another?
(d) Can I see my computer?
2. Suppose the world axes are transformed to our object axes by rotating them
counterclockwise around the y-axis by 42 o , then translating 6 units along
the z-axis and 12 units along the x-axis. Describe this transformation from
the perspective of a point on the object.
3. For the following sets of basis vectors, determine if they are linearly inde-
pendent. If not, describe why not.
2
4
3
5
2
4
3
5
2
4
3
5
1
0
0
0
0
0
0
2
0
(a)
,
,
2
3
2
4 −1
3
2
3
1
0
2
0
1
2
4
5
5
4
5
(b)
,
1
2
,
2
4
3
5
2
4 −1
3
5
2
4
3
5
2
4
3
5
1
2
3
−2
3
1
−3
(c)
,
2
3
,
,
Search WWH ::




Custom Search