วันเสาร์ที่ 23 สิงหาคม พ.ศ. 2557
Lab1 : star
void setup() {
size(400, 400);
background(#000000);
int top_point_starX = 166 ;
int top_point_starY = 50 ;
int circle_smallX = 300 ;
int circle_smallY = 450 ;
int circle_radius = 250 ;
noStroke() ;
fill(206,206,206);
triangle( top_point_starX, top_point_starY-20, top_point_starX, top_point_starY+75, top_point_starX-56, top_point_starY+95) ; //part1 of star1
triangle( top_point_starX, top_point_starY-20, top_point_starX, top_point_starY+75, top_point_starX+56, top_point_starY+95) ; //part2 of star1
triangle( top_point_starX-66, top_point_starY+18, top_point_starX, top_point_starY+75, top_point_starX+64, top_point_starY+18) ; //part3 of star1
fill(206,116,229);
triangle( top_point_starX, top_point_starY-10, top_point_starX, top_point_starY+65, top_point_starX-46, top_point_starY+85) ; //part1 of star2
triangle( top_point_starX, top_point_starY-10, top_point_starX, top_point_starY+65, top_point_starX+46, top_point_starY+85) ; //part2 of star2
triangle( top_point_starX-56, top_point_starY+21, top_point_starX, top_point_starY+65, top_point_starX+54, top_point_starY+21) ; //part3 of star2
fill(255); triangle( top_point_starX, top_point_starY, top_point_starX, top_point_starY+55, top_point_starX-36, top_point_starY+75) ; //part1 of star3
triangle( top_point_starX, top_point_starY, top_point_starX, top_point_starY+55, top_point_starX+36, top_point_starY+75) ; //part2 of star3
triangle( top_point_starX-46, top_point_starY+25, top_point_starX, top_point_starY+55, top_point_starX+44, top_point_starY+25) ; //part3 of star3
fill(255,0,0);
ellipse(circle_smallX,circle_smallY,circle_radius+150,circle_radius+150) ; //circle red
fill(255,255,0);
ellipse(circle_smallX,circle_smallY,circle_radius+100,circle_radius+100) ; //circle yellow
fill(0,153,76);
ellipse(circle_smallX,circle_smallY,circle_radius+50,circle_radius+50) ; // circle green
fill(0,0,102);
ellipse(circle_smallX,circle_smallY,circle_radius,circle_radius) ; //circle blue
fill(51,0,102); ellipse(circle_smallX,circle_smallY,circle_radius-50,circle_radius-50) ; //circle dark blue
fill(102,0,102);
ellipse(circle_smallX,circle_smallY,circle_radius-100,circle_radius-100) ; //circle purple
}
ป้ายกำกับ:
Lab1
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น