void setup(){ size(400,400); background(0); //背景白 stroke(255); //線は無し strokeWeight(10); } void draw(){ background(255); //背景白 float n = frameCount * 0.01f; //1秒間のフレームの数を緩やかに変える float r = 2000; //四角の長さに掛ける値 translate(width/2,height/2); //基準を真ん中にする for(int i = 0;i < 1000; i++){ //四角の数を変える fill(0); rotate(radians(i)); //軸を回転させる scale(1 - 0.01f * i/2); //大きさと四角の数を変える ellipse(cos(n * 1.1f)*r,n,sin(n*1.1f)*r,r); //基準に沿って四角を描いていく } }