float myNoise = 0.0; //ノイズの初期値 float start = 0.0; //myNoiseのスタート地点 float step = 0.02; //ステップの数値が少ないと変化が滑らかになる float theta; void setup() { size(400, 400); } void draw() { background(0); myNoise = start; //myNoiseをスタート地点で初期化 //画面中心から10方向で同時に線を描く for (int angle = 0; angle < 360; angle += 360/6) { translate(width / 2, height /2); //画面の中心へいどう rotate(radians(angle)); //angleの角度だけ回転 translate(-width/2, -height/2); //位置を戻す for (int x = 0; x < width; x += 5) { float y = noise(myNoise) * height ; //ノイズを使ってy座標を設定 stroke(x, y, y); line(x *20, y *20, x, y); //線を中心から描画 myNoise += step; //ノイズの値を更新 } } } void mousePressed() { start = random(10); //myNoiseのスタート位置を変える theta = int(random(0.001)); }