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

Soccer variable x,y,w,h

VERSION 6
i can expand the star picture in x-plane,y-plane by add variable w,h for expand.










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

void setup() {
       size(800, 800);
       stroke(0);
       background(255, 255, 255);
       
        int x=100;
        int y=300;
        int w=0;//100
        int h=100;//200
        
       rect(x-w,y-h, 300+w+w,300+h+h);
       ellipse(x+150, y+150,20+(w/2),20+h);
       
       line(x-w,y+150,x+300+w,y+150);
       
       line(x+130-(w/2),y-h,x+130-(w/2),y+20);
       line(x+170+(w/2),y-h,x+170+(w/2),y+20);
       line(x+130-(w/2),y+20,x+170+(w/2),y+20);
       
       line(x+130-(w/2),y+300+h,x+130-(w/2),y+280);
       line(x+170+(w/2),y+300+h,x+170+(w/2),y+280);
       line(x+130-(w/2),y+280,x+170+(w/2),y+280);
       
       
       
       
       stroke(126);
       
     } 


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

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