2008年5月12日 星期一

{ size(400, 400); background(255); smooth(); }void draw(){ int i,k=0; smooth(); translate(200, 200); stroke(0,0,0); strokeWeight(10); line(0,0,0,160); for(i=0;i<4;i++){ stroke(255-i*40,0,0); strokeWeight(5); line(0, 0, 80,0); rotate(PI/2); } if (mousePressed == true) k+=1; if((k%2) == 1){ for(i=0;i<16;i++){ stroke(255-i*10,0,0); rotate(PI/8); line(0, 0, 80,0); } }}

這次的考試
其實就掌握幾個重要的程式碼
應該就可以做的出來了

translate 物件位置
stroke 填充顏色
rotate 旋轉角度

沒有留言: