Files
sunny9898/task8/wk8/wk8_example1b/wk8_example1b.pde
louiscklaw 5637fbf94f update,
2025-02-01 02:07:58 +08:00

32 lines
630 B
Plaintext

int numCurves = 50;
float tt = 50; // change with time
void setup() {
//size(800, 600);
fullScreen();
noFill();
strokeWeight(2);
stroke(255);
noCursor();
}
void draw() {
background(0);
float ty = 100; // change with vertical position
for (int i = 0; i < numCurves; i++) {
float tx = 0; // change with horizontal position
beginShape();
float alpha = map(i, 0, numCurves, 50, 255);
stroke(255, alpha);
for (int x = 0; x < width -1; x+=10) {
float y = i*20 + noise(tx, ty, tt) * 400 - 50;
vertex(x, y);
tx += 0.02;
}
endShape();
ty += 0.05;
}
tt += 0.001;
}