44 ◾ 3D Animation for the Raw Beginner Using Maya
As the angle from the y-axis becomes larger, the value of sin(Θ) becomes larger and the
value of cos(Θ) becomes smaller.
What this tells us is that these two values track the eect of increasing or decreasing the
angle of rotation. ink of it this way: the black edges mark the size of the angle from the
horizontal axis. ere is a vertex where the red edge meets the top black edge, and a vertex
where the yellow edge meets the lower black edge. Call these vertices vertex Red and vertex
Yellow. Now imagine you start at vertex Yellow and rotate it upward to meet vertex Red.
Now, assume that h is equal to 1, that is, the radius of the circle is 1. is would mean that
cos(Θ
1
) = f
1
, cos(Θ
2
) = f
2
, sin(Θ
1
) = g
1
, sin(Θ
2
) = g
2
.
We see that vertex Yellow is at (f
2
, g
2
) and that vertex Red is at (f
1
, g
1
). In fact, as we move
from the smaller value for Θ to the bigger value for Θ, the increase of sin(Θ) tells us the
location of g
2
and the decrease in cos(Θ) tells us the location of f
2
.
is means that taking the sine and cosine of angles can tell us how to compute the rota-
tion of a vertex in 2-space, assuming that the center of rotation is (0, 0).
Translation, Scaling, and Rotation in 3-Space
e mathematics for rotating an object in 3-space is a bit more complicated. But the principle
is the same. Let’s step back, though, and look at the le of Figure2.19. Here, we see equations
that pertain to objects in 3-space, not in 2-space, like the circle at the right of the gure.
We assume that an object is represented by a set of vertices in 3-space, {[x
i
, y
i
, z
i
]},
and that its center is at [0,0,0]. The translation of this object in 3-space, the scaling of
an object in 3-space, and the rotation of an object around the x-axis can be calculated
as shown in Figure2.18. The reason that the third equation seems a little complex is
that our tool needs to know something about the angle through which the object is
being rotated. We looked at our circle to get an intuitive feeling for why there are sines
and cosines involved in the equations relating to rotation.
While these three tools represent basic and key components of the mathematics inside
a 3D modeling application, the job of calculating the shape of a model under develop-
ment is actually much more complex than this. e reason is that oen we do not treat
every vertex in an object equally. For example, sometimes we translate a single vertex in
3-space, and instead of doing the same with the vertices that are connected to this vertex
via edges, they remain xed, and we stretch the edges instead. We will see that Maya oers
an extremely complex set of modeling tools, but we should keep in mind that translation,
scaling, and rotation underlie much of what is going on inside its geometry engine.
In Sum
e primitive operations that underlie much of what we do in 3D modeling consist of translation
(move), rotation, and scaling. We use them to incrementally cra models out of objects, place
objects in geometric relationships to each other, and to animate objects in our scenes. Oen the
objects involved do not get directly rendered and consist of things like cameras and lights.
REFERENCE
Jones, H. 2001. Computer Graphics through Key Mathematics. London: Springer.