FORUMS: list search recent posts

Move object forward with constant distance but with random time segment.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mikhail Vasilev
Move object forward with constant distance but with random time segment.
on Jan 15, 2016 at 7:46:30 am

Hi there.

I want to Move object forward with constant distance but with random time segment.

For example
It stays for 1 sec then move forward 10 pixels, then it stays for 0.5 sec and again moves for 10 pixels forward
.............
I Tried Dan's "accumulative rotation" expressions but it rotate with constant time segment.


Return to posts index

Mikhail Vasilev
Re: Move object forward with constant distance but with random time segment.
on Jan 15, 2016 at 7:57:25 am

I've found some solution but now it works without ease )
It jumps.

segMin = .1; //minimum segment duration
segMax = 1; //maximum segment duration
minVal = [0, 10];
maxVal = [0, 100];
accum = 0; //initialize random accumulator

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


Return to posts index

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