-
Using Penner ease functions
I’ve started digging deeper into expression and assumed (wrongly) that controlling the value of an ease would be a simple function available in AE. After browsing the forum I’ve found that’s not the case!
Can someone please tell me how I might implement the top code into the bottom code so I can see how it’s done?
May be a stupid question so I’m sorry. It’s not the easiest thing to understand with little knowledge of Java. Thanks!
Math.easeInOutExpo = function (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2 * Math.pow( 2, 10 * (t - 1) ) + b;
t--;
return c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b;
};
function easeInOutCubic(t) { return t<.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1 };startVal = 100;
xendVal = 450;
yendVal = 800;
startDur = 1;
endDur = 1.8;t = linear(time,startDur,endDur,0,1);
e = easeInOutCubic(t);
y = linear(e,0,1,startVal,yendVal);
x = linear(e,0,1,startVal,xendVal);[x,y];