Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

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

 
submit tutorial
1 | 2
Calculating Wheel Rotation

By Kiel Figgins
| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star half
(5 Votes)
| 53496 Views
| 2 Comments
| Comments 2
Date Added: 26th March 2013
Software used:
Maya
1690_tid_main.jpg

Short Version

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

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

Introduction

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

The Process

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).

1690_tid_fig2_distVsdiff.jpg
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

1690_tid_fig3_circum.jpg
Fig.03 - Finding the circumference with a proxy cylinder



next page >

 
1 | 2
Related Tutorials

Tutorial

Gallery Image.



Keywords: Photoshop, Dwight Schrute, Caricature

Go to tutorial
rating star nonerating star nonerating star nonerating star nonerating star none (0)
Comments 0 Views 2712

Tutorial

Gallery Image.



Keywords: Photoshop, Dwight Schrute, Caricature

Go to galleries 1
rating star fullrating star fullrating star fullrating star nonerating star none
Comments 0 Views 2683

Tutorial

Gallery Image.



Keywords: KeyShot, Car, Scene, 3ds Max, Texturing

Go to galleries 1
rating star fullrating star fullrating star fullrating star halfrating star none
Comments 0 Views 12089

Tutorial

Gallery Image.



Keywords: ZBrush, Cartoon, Character, Maya, Female

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 1 Views 10423
Readers Comments (Newest on Top)
avatar
(ID: 189195, pid: 0) ChaosWolf on Tue, 26 March 2013 7:37pm
Wow, thanks for this awesome tutorial. Helps a lot. Oh yes this a Maya tutorial not Max, thanks Admin. :)
avatar
(ID: 189144, pid: 0) Sachin on Tue, 26 March 2013 3:23pm
Thanks Kiel for sharing. I have been a fan or your rigs..Thanks again for sharing
Add Your Comment