ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Continuous bounce

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan Ebberts
Re: Continuous bounce
on Jun 30, 2020 at 12:47:36 pm

This is slightly better:


freq = 0.5;
decay = 1;
val = value
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 1){
w = freq*Math.PI*2;
for (i = 2; i <= n; i++){
t = time - key(i).time;
if (t > 10/decay) continue;
amp = velocityAtTime(key(i).time - .001);
val += amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}
}
val



Dan



Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]