วันพุธที่ 22 กรกฎาคม พ.ศ. 2558

Spoon&Fox variable x,y,w,h

VERSION 5
i can expand the spoon and fox picture in x-plane,y-plane by add variable w,h for expand.










ใน VERSION 5  ได้มีการสร้างตัวแปร w และ ตัวแปร h เพื่อใช้ในการขยายภาพในแกน x และแกน y 

void setup() {
       size(800, 800);
       stroke(0);
       background(255, 255, 255);
       
        int x=200;
        int y=300;
        int w=0;//50
        int h=0;//25
        
       rect(x-w,y, 20+w+w,130+h);
       ellipse(x+10, y-60, 70+w, 90+h);
       
       
       rect(x+150-w,y, 20+w+w,130+h);
       line(x+130-w,y-10,x+190+w,y-10);
       line(x+130-w,y-10,x+130-w,y-100-(h/2)+10);
       line(x+160,y-10,x+160,y-90-(h/2));
       line(x+190+w,y-10,x+190+w,y-90-(h/2));
       
       
       
       stroke(126);
       

     } 


ไม่มีความคิดเห็น:

แสดงความคิดเห็น