pakt29
See /f0blog/pact-februari/
//pakt29
int cols, rows, index;
float oy;
float[] dashes;
void setup() {
size(640, 480, JAVA2D);
frameRate(60);
colorMode(HSB, 255);
smooth();
strokeWeight(20);
cols= 20;
rows= 20;
index= 0;
oy= 0.025*height;
dashes= new float[rows];
}
void draw() {
background(0);
for (int x= 0; x<cols; x++) {
float t= float(x)/cols;
float xx= t*width+(0.5/cols*width);
stroke(color(((sin(t*PI)*0.25+(index*0.0004+(x*0.02)))*255)%255, map(sin(t*PI), -1, 1, 0, 127), map(sin(t*PI), -1, 1, 0, 255)));
for (int y= 0; y<rows; y++) {
dashes[y]= sin((index+y)*(sin((index*0.1+(x*0.35))*0.01)*0.015))*10.0+(sin((index+x)*0.003)*40.0+70.0);
}
float off= index%(dashes[0]+dashes[1]);
float yy= height-oy;
int i= 0;
while (yy>(-0.5*height)) {
float d= dashes[i%rows];
if (i%2==0) {
float start= constrain(yy+off, oy, height-oy);
float end= constrain(yy-d+off, oy, height-oy);
if (start!=end) {
line(xx, start, xx, end);
}
}
yy -= d;
i += 1;
}
}
index++;
}