今天嘗試做類似慢慢要出隧道的感覺
其實也很簡單 就單純的讓360度都有一條線
每一條線都會不停的隨機長長短跟顏色
然後透過再疊一層360度的白色線
慢慢把scale拉大 就會有慢慢要出隧道的感覺
出了隧道又是什麼光景呢?
//簡單的背景設置
void setup(){
size(400,400);
background(255);
smooth();
}
size(400,400);
background(255);
smooth();
}
float t = 0;
void draw(){
t += 1;
if(t>60){
t=0;
j=0;
background(255);
}
//rotate((2*PI)/360);
frameRate(500);
flower02(random(width),random(height)); //先畫白色線圖層
flower01(random(width),random(height)); //再畫彩色線圖層
}
t += 1;
if(t>60){
t=0;
j=0;
background(255);
}
//rotate((2*PI)/360);
frameRate(500);
flower02(random(width),random(height)); //先畫白色線圖層
flower01(random(width),random(height)); //再畫彩色線圖層
}
float u = 0;
float j = 0;
float j = 0;
void flower01(float x, float y){
strokeWeight(2);
pushMatrix();
translate(200,200);
j += 1;
u = 1+(j/2);
scale(u);
for(int i=0; i<360; i+=1){
stroke(255,20);
rotate((2*PI)/360);
line(0,0,0,random(10,45));
}
popMatrix();
}
strokeWeight(2);
pushMatrix();
translate(200,200);
j += 1;
u = 1+(j/2);
scale(u);
for(int i=0; i<360; i+=1){
stroke(255,20);
rotate((2*PI)/360);
line(0,0,0,random(10,45));
}
popMatrix();
}
//下面是360度的彩色線圖層
void flower02(float x, float y){
strokeWeight(3);
pushMatrix();
translate(200,200);
j += 1;
u = 1+(j/20);
scale(u);
for(int i=0; i<360; i+=1){
stroke(random(255),random(255),random(255),50);
rotate((2*PI)/360);
line(0,0,0,random(30,165));
}
popMatrix();
}
strokeWeight(3);
pushMatrix();
translate(200,200);
j += 1;
u = 1+(j/20);
scale(u);
for(int i=0; i<360; i+=1){
stroke(random(255),random(255),random(255),50);
rotate((2*PI)/360);
line(0,0,0,random(30,165));
}
popMatrix();
}
Try it. :)
//下面是360度的白色線圖層