2008年4月8日 星期二

幾何畫










void setup()
{
size(800,600);
background(0);
smooth();
noLoop();//stop loop
}

void draw()
{
float lx,ca,cb,cc;

for(int j=0;j<600;j+=200)
{
for(int i=0;i<800;i+=200)
{
ca=random(0,255);
cb=random(0,255);
cc=random(0,255);
strokeWeight(4);
fill(ca,cb,cc,150); //顏色
rect(i,j,200,200); //正方形
lx=200;
for(int s=0;s<6;s++) //圓形繪畫
{
ca=random(0,255);
cb=random(0,255);
cc=random(0,255);
fill(ca,cb,cc,150);
lx-=30;
ellipse(i+100,j+100,lx,lx); //圓形
}
}
}
}

沒有留言: