-
scale bounce in one direction x or y
Hi, several year ago I posted about how to make a scale bounce, and Mr. Dan Ebberts send me this great expression, I abuse it a lot, and now I need to move it in only one direction, x or y. this is the expression.
Thanks
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
}if (n == 0){
value;
}else{
maxDev = 10; // max deviation in pixels
spd = 10; //speed of oscillation
decay = 3.0; //how fast it slows downt = time - marker.key(n).time ;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = x;[x,y]
}