Q:
To get to the point, what I want to do is animate a tire on a vehicle
with a controller so that the wheel will automatically spin the
correct amount as it moves forward (it doesn't look like it's slipping
/skidding etc.). I know it must be possible to retrieve the distance
it's travelled, relate it to circumference and then make it rotate so
that they match (the circumferencular [İCR 1996] distance and
travelled distance). I found an old post I saved by 3DJ Bobo which is
related, maybe you can help me convert this into a controller we can
all use???
A:
Here is a very basic expression for a linear car movement along the world's X axis.
Let's suppose the car consists only of a single CarObject and 4 Wheels linked to it.
- Open the Track View.
- Select the Transform/Rotation controller for the first Wheel.
- Add "Euler XYZ" controller, expand it.
- Select "Y Rotation" controller.
- Add "Float Expression" controller, right click, open Properties.
- Create a Vector "PosVect", Offset 0.
- Assign to the Vector "Transform/Position" of the CarObject.
- Create a Scalar "R" and assign a Constant = Radius of the Wheel. If the Wheel is made of a primitive like Tube or Cylinder, you may assign a Linear Float controller to it, then assign this controller to the Scalar "R".
- Enter the following expression in the Expression field:
(PosVect.x)/R
- Evaluate the Expression.
- Create an animation - lock the X axis and move the CarObject along it - the wheel should rotate accordingly.
- Save the Expression, load and assign to the other wheels.
This expression evaluates only the changes to the X-position of the car relative to the WCS. It works with a Linear Float, Bezier Float and TCB Float controllers for the Car motion, not with Path.
Addition:
The formula looks strange. Why does it work?
The actual formula looks like this:
PosVect.x
__________ * 2*pi
2*pi*R
It can be optimized and leads to the actual expression.