-
Dan’s random motion round to whole numbers
Hey Dan,
I use your random expressions from your site a lot. Tonight I plugged this into a repeater and can’t figure out how to include math.floor(value) in the mix to make whole numbers. Could you help me sort that out and explain why adding it to the bottom of the stack nullifies the whole expression? Thank you, sir!
segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 1;
maxVal = 7;end = 0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
endVal = random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal = random(minVal,maxVal);
ease(time,start,end,startVal,endVal)
Jason Jantzen
vimeo.com/jasonj