### Rotating Vehicle Tires

97,308

Feb 28, 2011

Basic

#### Maya Versions:

7.x, 6.x, 5.x, 4.x

#### Platforms:

irix, linux, mac, windows

#### Language:

English

Rotating Wheels on a Car

(Source files provided by Jim Gravina, Class of 2003)

The purpose of this handout is to show you how to rotate the wheels on a car so they follow the pace of the car as it move. By doing it this way, you will get a more accurate result without setting numerous keyframes. To do this, we will use the distance tool, set driven key, and infinity cycles in the graph editor.

Getting Accurate Distance Measurements

• The first thing you need to do before we get started is to group everything accordingly. Notice in Fig. 1 below, I have a group for each individual tire, a group for the car body, and a main group consisting of everything.

Fig. 1

• Once everything is grouped, all we really need to do is use the set driven key to animate the wheel rotation, but first we need to figure out how far the car must travel for the tires to go a full 260 degrees.

NOTE: If you want to be precise with the rotation, here is a formula you can use:

• Once again, use the distance tool to figure out the radius of the tire. To use the distance tool go to create > measure tools > distance tool. (Fig. 4- 5)

Go to create > measure tools > distance tool.

Fig. 2 - Click on the bottom middle of the tire to get a start point.

Fig. 2

Fig. 3 – Click on the top middle for the end point and press enter. You can see I have a radius of 4.16

Now plug that into the equation above and we get the following:

6.28 + 4.16 = 10.44

Now we know that when the car travels a distance of 10.44 the tires should rotate 360 degrees.

• So now we will use the distance tool one more time (create > measure tools > distance tool).
• Then click near the bottom middle of the front tire, then click and drag the end point a distance of 26.13 away. (Fig. 4 – 5)

 Fig. 4 – After going to create > measure tools > distance tool, click near the bottom center of the tire to get a start point.

Fig. 5 – Then click and drag until the distance says roughly 10.14.

Now we have a guide as to how far the car needs to travel for the tires to rotate 360 degrees and we can now start using the set driven key to animate it.

Animating the Rotation of the Tires

• Go to Animate > Set Driven Key > Set r . This will open the set driven key box where we can start working. (Fig. 6 – 7)

Fig. 6

Fig. 7

Now, for this we have the tires as four individual groups, the car’s body as a group, and everything together as a main group. So the Driver would be the main group (this is what will affect the tires rotation) and the Driven would be the individual tires (this is what is being affected).

• Select the main group and in the set driven key window, click load driver. (Fig. 8)

Fig. 8

• The car will be translating along both the X and Z axis, but we have to do each individually. So for now we will do the Z axis so Select translate Z to the right of the driver. (Fig. 9)

Fig. 9

• Now we will set the driven (the tires). Select all four tires, then in the set driven key window click load driven.   (Fig. 10)

Fig. 10

• When the car moves, we want the tires to rotate around the X axis. Now select all four tires in the driven section, then the rotate X to the right of the driven. (Fig. 11)

Fig. 11

• Now just press the Key button to set the keyframe for this position and rotation. (Fig. 12)

Fig. 12

We have now just keyed the beginning of the tire rotation. Now we need to key the end effector.

• Select the main group and move it so the front tire is at the end distance we calculated. (Fig. 12)

Fig. 12

• Then select the four tires and change the X rotation in the channel box to 360. (Fig. 13)

Fig. 13

• Then go back to the set driven key window and press the Key button. (Fig. 14)

Fig. 14

We have now just set the beginning rotation and the end rotation after the cars movement. Close the set driven key window, select the car and move it along the Z axis to test the results.

You will see the tires rotate, but only for that short distance we set it to. We need to cycle that rotation to an infinite amount.

• Select all four tires and go to Window > Animation Editors > Graph Editor. (Fig. 15) Then select all the curves in the window (Fig. 16).

Fig. 15

Fig. 16

Now we want to cycle the before and after rotation to an infinite amount.

• So go to Curves > Pre-Infinity > Cycle (fig. 17.). This will cycle the before motion.
• Then go to Curves > Post-Infinity > Cycle (Fig. 18). This will cycle the after motion.

Fig. 17

Fig. 18

That is it. Now close all the windows and select the car and drag it back and forth along the Z axis and the tires will rotate accordingly. Notice, if you move the car slow, the tires rotate slow. If you move the car fast, the tires rotate fast.

NOTE: The only other thing you would need to do is set the rotation of the tires for the X axis as well because chances are that the car will not only be moving along one axis. To do this, simply rotate the car 90 degrees along the Y axis so it is facing the X axis, and then repeat the steps above.

The only thing you will need to do different this time is change the Driver to translate X instead of Z like before. Everything else, including the rotation of the driven remains the same.

Jul 16, 2010
Post id: 11826

where is the tutorial?

Sep 30, 2010
Post id: 12619

someone steal it?????????????

Feb 27, 2011
Post id: 13923

What? Am i blind or something?

Feb 28, 2011
Post id: 13937

Sorry, it was there, I swear. I just added it again. It is a little old but still works well.

Mar 13, 2011
Post id: 14044

Thanks, one question:
For the formula (Px2) + Radius = Distance
How I can get the P value?. In others words, what it mean P value?

Mar 29, 2011
Post id: 14165

P is (Π constant) Value = 3.14

Jul 29, 2011
Post id: 15086

Thanks a lot,but I think the Distance result is wrong.The formula is: