-
Bounce y pos at each marker
I’m simply trying to write an expression to bounce y position at each marker. My current code produces unnatural results where the position immediately jumps at each marker.
Thanks.
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
}if (n == 0){
value;
} else {
freq = 1.0; //oscillations per second
amplitude = 90;
decay = .5;
t = time - marker.key(n).time;posCos = Math.abs(Math.cos(freq*t*2*Math.PI));
y = amplitude*posCos/Math.exp(decay*t);
position - [0,y]
}