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)
| 44257 Views
| 2 Comments
| Comments 2
Date Added: 26th March 2013
Software used:
Maya

Using the Distance Traveled Value to Drive Wheel Rotation

Having calculated the proper distance traveled, you'll need to gather the current rotation value of the wheel:

float $curAmount = `getAttr Wheel_Spin.rx`;

Now that you have the circumference, proper distance amount, and current rotation value, you can plug them into this equation:

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

What this equation is saying is: take the distance traveled, divide it by the circumference, multiply it by 360 (to put it into degrees), inverse it, then add it to the existing rotation amount. From here you'd set the $finAmount to the rotation channel, then set a keyframe:

setAttr Wheel_Spin.rx $finAmount;
setKeyframe Wheel_Spin.rx;

After that, you'd loop through all the frames, repeating this process. Since that would be pretty labor intensive, here's a MEL script to do it for you Download (Fig.04).

1690_tid_fig4_kfWheelRotation.jpg
Fig.04 - Wheel rotation MEL script


To use the script, go to Window > General Editors > Script Editor. In the Script Editor, go to File > Source Script and then run the following command:

kfWheelRotation();

Once the window opens, define the wheel object by selecting it, then pressing the < button. Fill in the remaining fields, set the timeline to the desired length and hit the Calculate button. If it all works out correctly, the script should run through the timeline and bake out the values.

Tips and Tricks

1. If you plan to use this process for a car, you'll need to calculate a new value per wheel, as each wheel travels slightly different amounts per frame. A slight modification to the script would allow you to do this without having to go through the timeline for each wheel.
2. Finding the circumference can be tedious and unnecessary to do each time you wish to run the script. If you find the circumference once, create a new channel on the wheel control and put the circumference value on that channel. Again, a small modification to the script to look for that channel and use the value could save you additional time and streamline the process.
3. When setting up a rig for a car, keep autoWheelSpin (or whatever channel you wish to drive the wheel rotation) as a separate channel. This would allow an animator to override or remove it if the shot calls for it. The creation of two channels: autoWheelSpin and manualWheelSpin would be added together to allow animators explicit control over the wheel.
4. For this process to work, you'll need the wheel transform to actual move per frame, not deform, as the calculation is still based off the pivot. If wheel is deforming, use the wheel control instead to find the distance.

Final Thoughts

Overall, calculating realistic wheel rotation is tricky, since a wheel has roughly four states: stopped, rolling, speeding up and cruising. Obviously, if the car is stopped, finding the rotation isn't necessary. Speeding up and cruising rotation values may need to be adjusted regardless, if the blur on the wheel starts to "wagon wheel" (spinning so fast the motion blur makes it look like its spinning slowly backwards) and becomes distracting. So that leaves rolling, a fairly rare shot in production. If you have a rolling shot, this process would be used (Fig.05).

1690_tid_fig5_motionBlur.jpg
Fig.05 - Example of motion blur causing a "wagon wheel" effect

Another factor is speed and scale. Speed is not always accurate in 3D, usually because the scene or assets aren't built to real world units or travel realistic distances.

When all's said and done, if your animation requires a precise rotation, the above approach should get you there. If it doesn't, than eyeballing the rotation values should be enough to keep you moving forward.




< previous page

 
1 | 2
Related Tutorials

Tutorial

Gallery Image.



Keywords: cartoon, creature, scarecrow, hat, eyes,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star half (3)
Comments 0 Views 31144

Tutorial

Gallery Image.



Keywords: car, vehicle, green, rogue,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star half
Comments 2 Views 31122

Tutorial

Gallery Image.



Keywords: character, cartoon, general,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star half
Comments 1 Views 53496

Tutorial

Gallery Image.



Keywords: vehicle, car, plymouth,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 70565
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