-
Random motion at layer markers > inertial bounce at each marker
Dan helped me out with this expression.
I’d like to alter it so that instead of the random position and inertial bounce occurring at time intervals, they occur at layer markers. This would allow greater flexibility to animate to say music.
//Dan Ebberts is my hero.
holdTime = .5; //time to hold each position (seconds)
t = time – Math.floor(time/holdTime)*holdTime;
minVal = [0.1*thisComp.width, 0.1*thisComp.height];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height];seed = Math.floor(time/holdTime);
seedRandom(seed,true);
p1 = random(minVal,maxVal);seedRandom(seed-1,true);
p0 = random(minVal,maxVal);v = p1 – p0;
amp = .05;
freq = 4.0;
decay = 2.0;
p1 + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);BTW: Dan Ebberts is my hero.