|09 September 2012||#1|
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||#2|
Join Date: Jun 2005
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).
ngskintools.com - skinning plugin for Autodesk Maya
|Thread Closed share thread|