VIDEOS: Commercials Corporate Video Demo Reels Music Videos Short Films Trailers More »

demo


Like     ---     Don't Like
demo
by
on Jul 13, 2012 at 1:31:01 pm
1024 Views
stop and go error
View 1 Comment(s)

Supports
Reply   Like  
Comments

Re: demo
by Dan Ebberts
I'm not sure what's going on. Do you have more than two keyframes? I did find a strange glitch where JavaScript's modulo operator (%) gives incorrect results in some cases. That causes the jump you're seeing. This version should correct that problem:


t1 = .5;
t2 = .3;
if (numKeys > 1 && time > key(1).time && time < key(2).time){
span = key(2).time - key(1).time;
steps = Math.floor(span/(t1+t2));
valPerStep = (key(2).value - key(1).value)/steps;
curStep = Math.floor((time-key(1).time)/(t1+t2));
if (curStep < steps){
t = (time-key(1).time)/(t1+t2) - curStep;
v1 = key(1).value + curStep*valPerStep;
ease(t,t1,t1+t2,v1,v1+valPerStep);
}else{
key(2).value;
}
}else
value


Dan

Embed
Link
© 2019 CreativeCOW.net All Rights Reserved
[TOP]