decay after keyframe POSITION one axis only

Moderators: Disciple, zlovatt

Post Reply
Varangian
Posts: 38
Joined: December 16th, 2004, 11:15 am

I have this great expression (below) that creates a continue of motion and decay after the last keyframe in a position animation on a 3D layer.

Problem is I only want it to happen on the Y-axis (not the x, or z-xais)
can anyone help me out and modify this?

the expression as is:

n = position.numKeys;
if (n > 0){
t = time - position.key(n).time;
if (t > 0){
freq =8;
amplitude = 50;
decay = 2.0;

s = amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
e = amplitude*Math.sin(freq*t*1*Math.PI)/Math.exp(decay*t)

value + [s,e]
}else{
value
}
}else{
value
}
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

Try this:

Code: Select all

n = position.numKeys;
if (n > 0){
t = time - position.key(n).time;
if (t > 0){
freq =8; 
amplitude = 50; 
decay = 2.0; 

//s = amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); 
e = amplitude*Math.sin(freq*t*1*Math.PI)/Math.exp(decay*t)

value + [0,e]
}else{
value
}
}else{
value
}
Koby.
Varangian
Posts: 38
Joined: December 16th, 2004, 11:15 am

worked great. Thanks Koby!
Post Reply