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

Star variable x,y,w,h

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












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

void setup() {
       size(800, 800);
       stroke(0);
       background(255, 255, 255);
     
        int x=200;
        int y=300;
        int w=0;
        int h=0;
 
     
 
     
       line(x-w,y-h,x+100,y-h);
       line(x+100,y-h,x+200,y-100-h);
       line(x+200,y-100-h,x+300,y-h);
       line(x+300,y-h,x+400+w,y-h);
       line(x+400+w,y-h,x+300+w,y+100);
       line(x-w,y-h,x+100-w,y+100);
       line(x+100-w,y+100,x-w,y+200+h);
       line(x-w,y+200+h,x+200,y+100+h);
       line(x+200,y+100+h,x+400+w,y+200+h);
       line(x+400+w,y+200+h,x+300+w,y+100);
       stroke(126);
     
     }

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

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