Skip to content

Instantly share code, notes, and snippets.

@seblavoie
Created July 10, 2013 19:42
Show Gist options
  • Save seblavoie/5969544 to your computer and use it in GitHub Desktop.
Save seblavoie/5969544 to your computer and use it in GitHub Desktop.
Easy ease wiggle expression. Found here: http://forums.creativecow.net/readpost/227/10295
tMin = .25; //minimum segment duration
tMax = .5; //maximum segment duration
minVal = [-50,-50];
maxVal = [50,50];
start=0;
end = 0;
j = 0;
while (time >= end){
j ++;
seedRandom(j,true);
start = end;
end += random(tMin,tMax);
}
endVal = random(minVal,maxVal);
seedRandom(j-1,true);
dummy = random(); //this is a throw-away value
startVal = random(minVal,maxVal);
wig = ease(time,start,end,startVal,endVal);
wig+value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment