Sporadic rotation expression?
So I'm trying to write an expression that randomly changes between one of three values and and smoothly transitions from the current value to a new one, and then holds for a while. So for example, an analog clock face where the hour hand rotates from 12:00 to 4:00 to 8:00, but in no particular order and with a long hold at each position.
I was starting with the following Dan Ebberts expression:
segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = [0.1*thisComp.width, 0.1*thisComp.height];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height];
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)
But the two problems I haven't been able to get around are a) I don't actually want to move to a random new value, I want to move... well, in this case, I want to move either up or down by 120º. And b) I can't figure out how to move and then hold. I keep feeling like it should be much simpler than I'm making it in my head.
Any ideas?
