FORUMS: list search recent posts

Wiggle range whole numbers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jason Jantzen
Wiggle range whole numbers
on Dec 1, 2016 at 12:08:15 am

I edited this expression from Dan Ebbert's random motion post, but can't figure out how to get whole number values.

segMin = .1; //minimum segment duration
segMax = .3; //maximum segment duration
minVal = 1;
maxVal = 5;

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);


Jason Jantzen
vimeo.com/jasonj


Return to posts index

Dan Ebberts
Re: Wiggle range whole numbers
on Dec 1, 2016 at 12:28:16 am

Try this:


segMin = .1; //minimum segment duration
segMax = .3; //maximum segment duration
minVal = 1;
maxVal = 5;

end = 0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
endVal = Math.floor(random(minVal,maxVal+1));
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal = Math.floor(random(minVal,maxVal+1));



Dan



Return to posts index

Jason Jantzen
Re: Wiggle range whole numbers
on Dec 1, 2016 at 12:32:46 am

Thanks Dan! I tried inserting Math.floor in various places in the expression but I don't understand the expression enough to modify it like that. This works perfectly :D

Jason Jantzen
vimeo.com/jasonj


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]