动画原理我们就不再讲了!
?这个代码实现了弹性缩放
rate = 700;
rampDur = value[0]/rate;
freq = 2;
decay = 8;
w = freq*Math.PI*2;
? if (time < (inPoint + rampDur)){
? ? s = linear(time,inPoint,inPoint+rampDur,0,value[0]);
? }else{
? ? t = time - (inPoint+rampDur);
? ? s = value[0] + rate*Math.sin(t*w)/Math.exp(t*decay)/w;
? }
[s,s]
弹性移动表达式
freq = 2;
decay = 5;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
amp = velocityAtTime(key(n).time - .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else
value
?
但是,AI的时代,一切都变得简单!解决方案当然是AI!
我正在用AE做动画,请你给我写一段嚷一个文字弹性翻转过来并慢慢停下的表达式代码