May 28
dur keyword’s iteration of an array of values, by using the (undocument) primitive unitinterval and a “normal” for loop. Example from his code:
for (unitinterval r in dur 500 fps 100) {
bookY = 420 + (r * -200);
bookOpacity = r;
bookScale = (0.8 * r);
bookRotation = -10 + (10 * r);
}
The value for r is going to be between 0 and 1 - So you will almost always have to use it with multiplication of a real value.
I suppose that in that case, you can say that the code x = [1..100] dur 500 is actually:
var x;
var arr = [1..100];
for (unitinterval s in dur 500) {
x = arr[s * sizeof arr];
}
October 16th, 2007 at 7:24 am
[…] Learn more about the dur operator here, here and here […]