### Keep up-to-date with Free tutorials!!

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

1 | 2
Calculating Wheel Rotation

By Kiel Figgins
| 67295 Views
| 2
Software used:
Maya

## Short Version

Don't just find the distance traveled; find the local difference between two frames:

float \$finAmount = ( (-((\$theDist / \$userCircum) * 360)) + \$difValue);

The most common approach to calculating wheel rotation, which is also similar to the one I use, is a postscript that bakes rotation per frame based on the distance traveled from the last frame. However, this process has certain drawbacks; for example, the wheel going straight up (such as being raised on an elevator) or fishtailing sideways. In these instances, the wheel is not moving forward, so would not need to rotate. The solution that I've found is a bit more involved than just judging distance per frame; it involves judging the difference per frame instead (Fig.01).

Fig.01 - Wheel rotation example movie

## Calculating the Orientation Distance Traveled

Once your wheel is animated traveling through space, you create a duplicate of your wheel on the current frame and another one frame ahead. Once these two duplicates are created, parent the first duplicate wheel under the second. The resulting tz, or corresponding translate axis, value of the first duplicated wheel is the difference in distance that will be used to rotate the wheel. Using this approach, you can determine the distance traveled with appropriate direction as well as reverse (Fig.02).

Fig.02 - Distance vs Difference

Though this process may seem confusing, you can see it working in this example:

• Make a wheel (cylinder) at origin (name it "wheelOrg")
• Duplicate wheelOrg, and name it "wheelDiff"
• For forward motion:
- Set wheelDiff.tz to 10
- Parent wheelOrg to wheelDiff
- The tz of wheelOrg is now -10

• For reverse motion:
- unparent wheelOrg from wheelDiff
- Set tz of wheelOrg to -10
- Parent wheelOrg to wheelDiff
- The tz of wheelOrg is 10

From this example, if you were only using the distance between the two points (or frames), you'd get the same value of 10. However, using the "difference" method, you get a value that will indicate direction changes. Repeating this example by plugging in a value of 10 in Translate Y of wheelDiff, you'll see that even though the wheel movds, the rotation would not be calculated because it didn't move on its 'forward' axis.

## Finding the Circumference of the Wheel

Finding the circumference of a wheel is pretty straight forward (Fig.03):

• Create a default polyCylinder
• Align the cylinder to the wheel, but don't scale it, only use position and rotation
• Using the INPUTS of polyCylinder1, adjust the radius amount until they're the same size
• Use that radius amount in the following equation to find the circumference:

c = 2 * 3.14159 * radius Amount

Fig.03 - Finding the circumference with a proxy cylinder

## next page >

1 | 2
Related Tutorials

Tutorial

Gallery Image.

Keywords: twins, ricardo manso,

(8)
1 5903

Tutorial

Gallery Image.

Keywords: Sylvain Klein, Maya, car, Lykan, making of

0 5344

Tutorial

Gallery Image.

Keywords: cartoon, character, caricature, rajak, emilie stabell,

0 10053

Tutorial

Gallery Image.

Keywords: vehicle, car, fiat, 500,

0 67996