The Maya Interface and Modeling Concepts in Maya 41
localized changes to the shape of the curve without redrawing or redening the entire
curve.
Bezier made a discovery. He could specify a curve with very few points, scale a curve up
to any size, and ne-tune a curve quickly and easily.
Look at Figure2.15 again. It’s more complicated than specifying a straight line, but it’s
radically better than specifying a huge number of points for a curved line. Remember that
although we are modeling in 3-space, all of our lines are in 2-space. So, all we need is a way
to calculate as many x and y coordinate pairs as we need for a given curve. True, we would
probably want more coordinate pairs the larger we scale a curve up, but it would still be a
modest number of calculations to create a smooth curve. So, Bezier’s technique allows us
to scale a curve up as large as we want to without creating a computational bottleneck and
without losing any accuracy. Bezier could draw a simple curve on a piece of paper, then just
give the factory a handful of CVs and two polynomials, and boom—a car-sized curve could
be created in a precise fashion.
ere are two polynomials in Figure2.15.
One species the x coordinate and the other
species the y coordinate. We can quickly
calculate as many (x, y) points on the curve
as we want by using the two polynomials,
one for the x-axis and one for the y-axis. It is
a very compact mechanism, as the polyno-
mials are simple and quick to calculate. is
means that a curve can be easily scaled to
whatever sized device is being used to dis-
play the curve, and we can adjust the con-
stants in the polynomials to adjust a curve.
Lets go back to Maya terminology.
Points are vertices. ere are really two
kinds of vertices in a curve: the vertices
along the curve and the control vertices
used to calculate the vertices along the
curve. For polynomials of degree 3, like
the polynomials in Figure 2.15, we need
four control vertices, two of which are the
end vertices and two of which are not on
the curve. In Figure2.16, we see a basic
xt xtxx tx xxtx xxx
yt ytyy ty yyty yyy
t
=+ −+ +− +−+−
=+ −+ +− +−+−
≤≤
[] 3( )3(2)(
33
)
[] 3( )3(2)(
33
)
01
010
2
02 1
3
30
12
010
2
02 1
3
30
12
FIGURE 2.15 Bezier polynomials.
FIGURE 2.16 A Bezier curve.
42 3D Animation for the Raw Beginner Using Maya
Bezier curve. Notice how elegantly we
can visualize the relationship between the
single center control vertex and the shape
of the curve. By moving around the vertex
in the upper le, we change the shape of
the curve below it. ere is another curve
in Figure2.17 (which has been annotated),
and it has two internal CVs. By moving
them around, we can smoothly change the
shape of the curve below it. e point is
that the polynomials remain the same; all
we have to do is create the CVs and move
them around, and thus allow the polyno-
mials to dynamically create the precise
curve we want.
CORE TOOLS: TRANSLATE, SCALE, AND ROTATE IN MAYA
ere are three basic tools that we use while we are craing a model and/or animating a scene.
Maya also employs them under the covers, oen without us being explicitly aware. ese are
the basic 3D primitive operations for moving an object, scaling an object, and rotating an
object. (e Move tool is more generally known as Translate. But we’ll use Maya’s term and
just call it Move from now on.)
Remember that objects in Maya consist of vertices in 3-space, along with straight or
curved lines that connect these points. To make our discussion simpler here, we will think
only about straight line (polygon) geometry, but our discussion can be extended to involve
NURBS curves along with their control vertices.
Consider Figure2.18. In the upper left is a basic Maya modeling primitive, a cube.
(It has already been scaled along the y-axis.) To the right is the same cube after it
has been re scaled along the x-axis. The dotted part shows the outline of the original
cube. The lower right of the figure shows the cube from the upper left before and
after it has been translated (moved) through 3-space. In the lower left of the figure
we see the cube from the upper left before and after it has been rotated around the
y-axis. In the white box in the very upper right is the mathematics behind all of this.
I have taken these equations directly from Jones (2001). Lets take an intuitive look
at this.
Some Trig
For now, ignore the equations to the le of Figure 2.19. To the right of Figure2.19 is a
diagram that my daughter Isabelle helped me engineer. ere is an orange circle. In light
blue are the x-axis and y-axis. ey meet at the origin of the circle, at (0,0). e black lines
are equal in length and each of them is the radius of the circle (half the diameter).
FIGURE 2.17 An annotated curve.
The Maya Interface and Modeling Concepts in Maya 43
e point of this diagram is to focus on two particular triangles in the image. ey are
in the upper right of the circle. e rst has a black line as its hypotenuse, a red line for its
vertical edge, and a green line for its horizontal edge. e second triangle also has a black
line as its hypotenuse, and has a yellow line for its vertical edge, and a combined green and
brown line for its horizontal edge. e two triangles have identical hypotenuses, which are
the length of the radius of the circle.
For each of these triangles, lets call the angle from the horizontal axis to the hypot-
enuse θ. For the triangle with the red vertical edge, this value is about 75 degrees. For the
triangle with the yellow vertical edge, this value is perhaps 30 degrees. Let’s dene two
operators: cos(Θ) = f
d
/h and sin(Θ) = g
d
/h, where the length of the black lines = length of
the hypotenuse = h, length of the red line = g
1
, length of the yellow line = g
2
, length of the
green line = f
1
, and length of the concatenated green/brown lines = f
2
.
FIGURE 2.18 Translate, rotate, and scale with equations.
FIGURE 2.19 (See p. CI-1 of Color Insert) Translate, rotate, and scale.
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 eect 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. Lets step back, though, and look at the le of Figure2.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 Figure2.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 oen 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 oers
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. Oen 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.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.202.167