ramdom_rotate_lines01
void setup() { size(500, 500); colorMode(HSB, 360, 100, 100, 100); background(0, 0, 100); strokeWeight(1); smooth(); frameRate(5); } void draw() { int xstep = 1; int ystep = 50; float lastx = -999; float lasty = -999; float ynoise = random(10); float ny; background(0, 0, 100, 2); translate(0, -30); stroke(360%frameCount, 80, 90); for (int y = 0; y<= height/2; y += xstep) { for (int x= 0; x<= width/2; x += ystep ) { ny = y + noise(ynoise) * 80; if (lastx > -999) { pushMatrix(); translate(width/2, height/2); rotate(frameCount); line(x, ny, lastx, lasty); popMatrix(); } lastx = x; lasty = ny; ynoise += 0.1; } } }
ランダムな線を回転させてみた.線を1本ずつ回転させたかったのだけれど,全体が回ってしまった.失敗…