float myNoise = 0.0; //ノイズの初期値 float start = 0.0; //myNoiseのスタート地点 float step = 0.02; //ステップの数値が少ないと変化が滑らかになる //float []x = new float[3]; //float []y = new float[3]; float x,y; float x_1, y_1, x_2, y_2, x_3, y_3; int R = 200; int r = 200; void setup() { size(400, 400); } void draw() { background(255); //stroke(0, 255, 0); myNoise = start; //myNoiseをスタート地点で初期化 for (int i = 0; i <= 360; i ++) { for (int ii = 0; ii<3; ii++) { x = R*cos(noise(myNoise)*360); y = -R*sin(noise(myNoise)*360); x_1 = (noise(myNoise)*r)*cos(noise(myNoise)*360); y_1 = -(noise(myNoise)*r)*sin(noise(myNoise)*360); x_2 = (noise(myNoise)*100)*cos(noise(myNoise)*360); y_2 = -(noise(myNoise)*100)*sin(noise(myNoise)*360); x_3 = (noise(myNoise)*250)*cos(noise(myNoise)*360); y_3 = -(noise(myNoise)*250)*sin(noise(myNoise)*360); stroke(0); line(x + width/2, y + height/2, x_1 + width/2, y_1 + height/2); stroke(255); line(x_2 + width/2, y_2 + height/2, x_3 + width/2, y_3 + height/2); myNoise += step; //ノイズの値を更新 } } } void mousePressed() { start = random(10); //myNoiseのスタート位置を変える }