2008年5月5日 星期一

康乃馨

網頁:http://ss24.mcu.edu.tw/~s4360786/flower/

程式碼:
void setup()
{
size(800,600);
background(0);
}
void draw()
{
}
void mousePressed()
{
smooth();
stroke(1, 10);
translate(mouseX, mouseY); // Set initial offset
float x=random(10,150);
fill(255,x,x);
for (int i = 0; i < 18; i++) { // 18 repetitions
strokeWeight(i); // Increase stroke weight
rotate(PI/4.8); // Accumulate the rotation
ellipse(0,0,60,10);
}
fill(255,190,190);
ellipse(0,0,5,5);
}

沒有留言: