Rotating wheels

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  09 September 2012
Rotating wheels


I'm trying to create a rig or the wheels of a car. I've written an expression to make the wheel rotate when you move the car forward (in Z direction).

My expression :
Wheel.rotateX = 360 * group1.translateZ / (2* 3.14 * radius)

This works perfectly, untill you try to make the car turn, since the wheels only rotate when you move the car along th Z axes... So when I attach it to a motion path the wheels stop rotation when the car makes the turn...

Any ideas on how to solve this?
  09 September 2012
In general, you can't calculate wheel's rotation just by it's current position.

This sentence might infuriate some people, especially those with your expression above, saying "it works on one axis, help me make it work on all others". The truth is, you can only get correct results with simulation. By "simulation" I mean that when calculating current rotation, you have to know wheel's position+rotation in previous time sample and how much travel was made between previous and current time.

to make matters more complicated, you'll have to decide what you want to do when wheel rotation is not perpendicular to travel axis: options include - orient wheel to travel axis automatically, rotate only this much to decrease sliding effect to a minimum, rotate wheel around axis perpendicular to travel axis (stupid but still an option). This all will involve a minimum knowledge of what a transformation matrix is.

All in all, for a beginner my answer would be - just keyframe wheel rotation manually. You won't make it foolproof to adjust rotation automatically, so some sliding will happen anyway, and depending on what you want to animate, you'll want your wheels to have their own rotation (e.g., hard brakes, traction control effects etc).
Victor - skinning plugin for Autodesk Maya
  10 October 2012
you'll want to find the difference the current vector of the wheel and the vector on the previous frame and then use the magnitude to calculate the rotation.
blah blah blah
  10 October 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:12 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.