-
Intertial Bounce Effect… but backwards?
I’ve been using the inertial bounce expression from this website:
https://www.graymachine.com/blog/my-top-expressions
(Code Below)
I’m trying to do the same effect, but in reverse. In other words, rather than moving and then swinging to a stop, I want it to be at rest, swing bigger and bigger, and then go.
To see what I’m trying to do, use the code below on the rotation of an object. Put two points… one at 0 degrees and one at 90. Then just play the animation you get in reverse.
Any idea how to do that? I feel like there should be a simple tweak I can make to the code to do it, but nothing I’ve tried so far works.
Another step from that which would be really cool would be to be able to do both in the same animation.
Thanks for any help.
amp = .1;
freq = 2.0;
decay = 2.0;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
}
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
}