2008年4月2日 星期三

Processing做出的自畫圖

原本自己畫的幾何圖

用Processing自己畫出的幾何圖


程式碼

void setup()
{
size(800 , 600);
background(255,248,120);
noLoop();
}
void draw()
{
diagonals(90, 90);
}
void diagonals(int x, int y)
{
fill(0,70,107);
ellipse(750,280,20,20 );
fill(0,70,107);
ellipse(650,230,40,40 );
fill(0,70,107);
ellipse(70,300,20,20 );
fill(0,70,107);
ellipse(170,370,40,40 );
fill(68,255,0);
rect(75,400,150,150 );
fill(68,255,0);
rect(600,47,150,150 );
fill(165,0,165);
ellipse(150,130,190,190 );
fill(165,0,165);
ellipse(670,470,190,190 );
fill(0,255,255);
rect(315,200,210,400 );
fill(255,0,0);
ellipse(310,270,120,220);
fill(255,0,0);
ellipse(520,270,120,220);
fill(68,255,0);
ellipse(415,250,150,40);
fill(255,248,120);
ellipse(310,270,30,40);
fill(255,248,120);
ellipse(520,270,30,40);
fill(60,138,255);
rect(x+220,y,220,120 );
fill(0,0,0);
ellipse(415,450,150,10);

strokeWeight(3);
line(315,380, 315,600);
line(525,380, 525,600);
}

沒有留言: