【Processing】うねうね動くやつ

 

94.hatenadiary.jp

 

昨日のコードをまたいじくった。

三角形を四角に。

それから背景に溶け込ませるように。

あとコードをちゃんと書き直した。

 

float a = 0;
float n = 0.01;

void setup(){
size(500,500);
frameRate(30);

}


void draw(){
background(0,0,0);
pushMatrix();//---------
translate(width/2,height/2);
int max = 250;
for(int i = 0; i < max;i++ ){

  translate(0,0);
  rotate(radians(a));
  stroke(255-i,i);
  strokeWeight(0.1);
  noStroke();
  fill(3*i,i,i);
  quad(-max + i,0,0,max-i, max - i,0,0,-max+i);
  float noise =  i /20.8;
  a = map(noise(noise + n),0,1, -10,10);
}
  n+=0.005;
popMatrix();//----------
  
}