PDA

View Full Version : write script to control the motion


aniOcean
11-21-2008, 03:31 AM
When I want to animate a object, how to write the script to make it move faster between 1sec to 4sec and move slower after that?

Any help is appreciate

Mylenium
11-21-2008, 09:21 AM
I don't see what this would do beyond what you can do with keyframes? Other than that, acceleration is still the square function of time, so for a linear motion along X you'd probably use something like this:


rAccel=5; //rate of acceleration

if (time <= 4)
{X = rAccel*Math.pow(time,2)}
else
{X = valueAtTime(4)[0]};

Y=value;

[X,Y]


Mylenium

StevePatterson
11-21-2008, 03:44 PM
You may want to experiment with adjusting the value and speed curves using the graph editor as well.

CGTalk Moderation
11-21-2008, 03:44 PM
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.