PDA

View Full Version : animating a car at a constant speed along a curve?



monovich
09-02-2009, 10:25 AM
Howdy,

I wanted to check here and see how other people are animating cars just to see if there are better ways of doing it than I am doing.

What I want a car to do is follow a curvy path along a road, but have it follow the path at a constant speed.

how do you make sure your keyframes are spaced correctly to make sure the car doesn't travel at X speed between points A and B and then at Y speed between points B and C? In a straight line this is easy, but with many curves its a little trickier for me because its tricky to evaluate the distance between points on a curve.

As long as I am at it, how do you have the car orient along the curve? Do you use Align to Path or some other method? I find that Align to patch has jerky movements at the keyframes. I try to tweak the TCB, but its basically impossible for me to get right. I end up aligning the car by hand, but sometimes its a little hard to get right as well.

thanks for any help!

-SF

CC Rider
09-02-2009, 12:03 PM
I'm sure most everyone who chimes in will have a better method than this, but If you are okay with the eyeball approach:
Space you keyframes as evenly as you can to your eye, and in graph editor, use the "show velocity" trick to smooth out the transitions between keyframes. With "show velocity" active, you can adjust the tension of a keyframe so that the speed incoming and outgoing flow evenly. This won't guarantee that the speed is absolutely constant throughout (which may look strange anyway...vehicles will usually adjust speed around a curve) but at least it won't look like someone trying to learn to drive a stick for the first time...

:D

monovich
09-02-2009, 12:56 PM
show velocity, huh? where do you do that? sounds like a new concept to me!

nevermind. found it.

what is the difference between speed and velocity?

thx!

BlueApple
09-02-2009, 01:06 PM
Velocity accounts for both direction and speed.

monovich
09-02-2009, 01:11 PM
okay wow. this is a whole new world to me. this is working great!

CC Rider
09-02-2009, 01:13 PM
Its in the graph editor...
Try this:
Open a new scene. Add a null. Move the null to 3 different random spots at 3 different frames (so you'll have 3 keyframes)

Open the graph editor.
Select the channel you want to adjust.
Let's say "x" position...

You'll have 3 keyframes there and you want to make sure the movement from keyframe 1 goes smoothly into keyframe 2 and on into keyframe 3 correct?

make sure only the middle keyframe is selected. (right click and drag to select it...this will deselect any other keyframes if they are selected.)
Right click on the "x position" channel and select "show velocity".
You'll see a white curve overlay in the graph editor.
Adjust the tension of the middle keyframe until the graph looks nice and smooth at the 2nd keyframe area. You'll see the graph curve change shape as you adjust the tension back and forth.
When you have a nice smooth curve, your velocity will stay consistant.

Pretty handy tool!

:D

CC Rider
09-02-2009, 01:14 PM
Lots of posts in the time it took to reply to your post...looks like you got it...

SplineGod
09-02-2009, 02:07 PM
You can also convert your motion path to a spline in modeler, export that back to Layout and use the curve constraint plugin which has an envelope to control the speed along that path.
Ive also used Dponts Node Item Motion which has a time input. This has allowed me to create my motion path in layout but control the time that it takes to traverse the path independantly.

adk
09-02-2009, 05:23 PM
... you could also try and see if you could use DPont's nodes like in this thread.

http://www.newtek.com/forums/showthread.php?t=100490