
March 2002
Rigging A
Vehicle
by Kris Kapp
I recently spent a lot
of time rigging various vehicles for animation and came
up with a few tricks. One of the main differences with
vehicles instead of characters is that you don’t have to
worry about binding a mesh to a skeleton. You still,
however, have to make a control system that is easy to
use and flexible to cover most situations.
One of the cool things
about Maya is the ability to add attributes to objects.
One trick is to use a curve as a control object and then
add custom attributes to that curve. If you want to get
fancy, you can make a curve in Illustrator and import it
into Maya.

Image 1 -- Arrow
created in Illustrator |

Image 2 -- Stand
in geometry
with control curves |
I created this arrow in
Illustrator and imported it as an EPS. I am going to use
this as a control object for the main body of the
vehicle I am working on.
One good thing about
using curves is that you can lock all the attributes of
the geometry and set the object selection masks to
curves. That way you can only select the curves and not
worry about disrupting the geometry. By using the
connection editor, you can set multiple pivot points for
groups wired into the control curves. For example: The
jeep has a canon on top that rotates on three axis but
each axis needs a different pivot point. By using nurbs
circle as a control object this is easy to achieve.

Image 3 -- Barrel
rotation setup |

Image 4 - Barrel
pivots up and down |
It might be hard to tell from the images but the
barrel has a different pivot point for the X and Z
rotations. Now if we pivot the curve in Y, it easier to
see the different pivot for that rotation.

Image 5 -- Entire base
pivots
A little planning is needed with how the cannon
hierarchy is developed. In this case, start with the
cannons base and group it. This group node will be the
root node of the cannon hierarchy. Set the pivot for the
cannon base group to where you want the Y axis to
rotate. Group the cannon barrel and parent that group to
the cannon base group. You don’t have to group the
geometry but I find it better to do it this way as
opposed to working directly with cannon geometry. It
helps when you have a lot of complicated, small sections
of geometry. I then grouped that group again so now I
have a series of three groups for the cannon, the base
group, the barrel X rotate group, and the barrel Z
rotate group. Set the pivots for each group so each
rotates around the correct axis.

Image 6 -- Actual
cannon and base geometry
Now with the connection editor we’ll wire up the
cannon groups to the cannon control curve. On the left
side, load the cannon control curve. On the right side,
load up the cannon base group. Connect the rotate Y on
the cannon control curve to the cannon base group. Next
load the barrel Z rotate group and connect the Z
rotation. Do the same for the barrel X rotate group. So
now by just selecting the one curve you can rotate the
cannon three different ways. I also added attributes to
the curve to allow for the barrels recoiling. The barrel
recoil was handled with Set Driven Keys.
Next we’ll tackle the suspension. At the tire, create
a joint chain of three joints that will act as a shock.
Add an IK Handle to the joint chain so you can keep the
tires on the ground independent of the vehicles body.

Image 7 -- Tire joint
chain
I created a curve box around the tire. I have a MEL
script for this:
curve -d 1 -p 9.26493 1.180816 1.180816 -p 9.26493
1.180816 -1.180816 -p 6.903298 1.180816 -1.180816 -p
6.903298 1.180816 1.180816 -p 9.26493 1.180816 1.180816
-p 9.26493 -1.180816 1.180816 -p 6.903298 -1.180816
1.180816 -p 6.903298 1.180816 1.180816 -p 6.903298
1.180816 -1.180816 -p 6.903298 -1.180816 -1.180816 -p
6.903298 -1.180816 1.180816 -p 9.26493 -1.180816
1.180816 -p 9.26493 -1.180816 -1.180816 -p 6.903298
-1.180816 -1.180816 -p 6.903298 1.180816 -1.180816 -p
9.26493 1.180816 -1.180816 -p 9.26493 -1.180816
-1.180816 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8
-k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 ; xform
-cp;
This script (I got this script from Chris Clay) will
create a box shaped curve. I scaled and translated it so
it fit around the tire. I then did a freeze
transformations on it and moved its pivot point to the
bottom center of the box curve. I named the curve
WheelCtl. I grouped all of the tire elements and
parented this group under the WheelCtrl curve. I then
added a Point Constraint from the IK Handle to the
WheelCtrl curve, so that when I move the WheelCtrl, the
IK Handle moves with it.
I grouped the root joint and parented that group to
the main body group of the vehicle. This way, you could
animate the body of the car but the wheels will stay in
contact with the ground.
For body control setup, I created an arrow curve in
Illustrator and imported it into Maya as an EPS. I
scaled it, rotated, and translated it into position at
the front of the vehicle, and froze its transformations.
Then using the connection editor, I connected the Y
rotate to the twist attribute of the IK handle of the
WheelCtrl curve. I then connected the twist attribute of
the IK Handle to the Y rotate attribute of the WheelCtrl
curve. This is so that when I rotate the BodyCtrl curve
in Y, the front wheels will rotate in Y. I only did this
for the front wheels because the rear wheels only spin,
they don’t turn.

Image 8 -- Front
wheel setup
I took the main body geometry group and connected all
of its translate attributes to the BodyCtrl curve so
that when I moved the BodyCtrl curve, the body geometry
would move also. I also wired up the body Rotate X and Z
to the same attributes on the BodyCtrl curve. Just by
animating the body ctrl curve, the vehicle would bounce
and sway and turn its front wheels. I then added custom
attributes for the front and rear wheel spin. Then for
each tire group I added the following expression:
l_FrontWheelGrp.rotateX=((frame)*31)*BodyCtrl.FrontWheelSpin;
This shows that the left, front wheel group will
rotate around the X axis based on the value of the
FrontWheelSpin attribute. The higher the value in the
wheelspin attribute, the more the tire spins. If the
value is set to zero, the tire doesn’t spin. This way
proved to be flexible enough for the animators and
worked better than an expression that would
automatically rotate the tire based on how far the
vehicle was translated. The 31 is just a multiplier I
came up with that gave the results I wanted, plus it is
a prime number doesn’t contain a multiple of 360.
Next I added a control to get the wheels to act like
they were connected through as axel. First I grouped the
control curves for the front two wheels and centered the
pivot for that group to get the needed rotations. I
created a half circle shaped control curve then I just
piped the rotation attributes from the group into the
new control curve.

Image 9 -- Axel control
curve
Lastly I created a box curve and scaled and
translated it to fit around the entire vehicle. I
grouped all of the other control curves and geometry
groups to this so I could move the entire vehicle just
by moving and rotating this main control curve. Part of
the nice thing about using curves is that you can assign
them to different layers, with the layers having
different colors assigned to them, making it easier to
tell what those curves do. For example, you might want
to assign all the right hand controls one color and all
the left hand controls another color. Another advantage
is that curves are a lot easier to grab then a lot of
different handles or locators.
I deliberately made this tutorial a lot more general
than some of the others that I have written. If you have
any questions please contact me at
kris.kapp@riskstudios.com.
You can see some of examples of my rigs in the GI Joe ad
at:
http://www.gijoe.com/gijoe/experience/video/ad01.mpg
Bio:
An award winning animator and experienced game industry
artist, Kris Kapp has done it all from low poly modeling
to cinematic animations. He was awarded most outstanding
portfolio in his graduating class, and more recently,
Kris was nominated for 3D Designs Big Kahuna award in
the category of best story telling. Along with serving
as layout supervisor on the animated short "Major
Damage," Kris recently founded his own animation
company,
Risk Studios. Indicative of his studio name, Kris is
also a pilot and a champion motorcycle road racer.
More from Kris Kapp:
Character
Animation Part 1 – Character Modeling using Nurbs Primitives and
Sub-Divisions Surfaces Or How to Make a Chicken From Scratch by Kris
Kapp
I modeled this chicken over the course of a couple of evenings. I needed
a character that would offset my last one, the Rabbit of the Apocalypse.
The rabbit character is tall, emaciated, and rather sickly. I wanted the
next character to be more robust. So, after a buddy gave me a t-shirt
from a bar in New Hampshire called the Black Cock, I knew what my next
character would be...More
Character
Animation Part 2 – Foot Setup For a Chicken by Kris Kapp
Last time I talked about modeling the chicken. This time I’ll go into
how I set up the foot controls. I decided to use a "reverse
foot" to drive the leg IK. The advantage of the reverse foot is
that it gives you a solid heel that you can plant just like a real foot.
Normally you would build a skeleton and do a test bind on the geometry
before building fancy controls...More
Basic Skeletion Set-Up for "The
Chicken" by Kris Kapp
Kris Kapp goes back into the Maya kitchen for some ribs and wings...More
Chicken
Head Set Up by Kris Kapp
Finger lickin' good Kris Kapp ties on his Maya apron and sets his sights
on the chicken head...More
(August 2001)
Chicken Head Setup
by Kris Kapp -- Addendum -- More UV Mapping Fun with the Chicken by
Kris Kapp
Last time I showed an example of how to generate UVs for a nurb-to-poly
object by using the chicken’s head as an example. I did it that way
because I was having hard time working with Maya’s UV tools. Maya does
some strange things with the way it does its cylinder mapping, and I
ended up laying out the UVs for the head pretty much by hand...More
(September 2001)
|