สิงหาคม 23, 2558

Lab1_book

void setup(){
  int posX=150, posY=200;
  size(300,400);
  background(0);  //colorBlack
  //bones
  fill(255);  //colorWhite
  noStroke();
  beginShape();
  vertex(posX-90,posY-110);
  vertex(posX+110,posY+90);
  vertex(posX+110,posY+110);
  vertex(posX+90,posY+110);
  vertex(posX-110,posY-90);
  vertex(posX-110,posY-110);
  endShape();
  beginShape();
  vertex(posX+90,posY-110);
  vertex(posX-110,posY+90);
  vertex(posX-110,posY+110);
  vertex(posX-90,posY+110);
  vertex(posX+110,posY-90);
  vertex(posX+110,posY-110);
  endShape();
  ellipse(posX-100,posY-120,30,30);
  ellipse(posX-120,posY-100,30,30);
  ellipse(posX+100,posY-120,30,30);
  ellipse(posX+120,posY-100,30,30);
  ellipse(posX+120,posY+100,30,30);
  ellipse(posX+100,posY+120,30,30);
  ellipse(posX-100,posY+120,30,30);
  ellipse(posX-120,posY+100,30,30);
  //skull & hat
  stroke(0);
  strokeWeight(4);
  ellipse(posX,posY+90,80,90);
  fill(145,55,25);  //colorBrown
  arc(posX,posY,170,170,PI+PI/16,TWO_PI-PI/16,OPEN);
  fill(255,210,50); //colorYellow
  arc(posX,posY,170,170,PI+PI/7,TWO_PI-PI/7,CHORD);
  arc(posX,posY+30,320,115,PI+PI/5,TWO_PI-PI/5,PIE);
  fill(255); //colorWhite
  arc(posX,posY,170,170,0,PI);
  arc(posX,posY,170,30,PI,TWO_PI);
  //detail
  fill(0);
  ellipse(posX,posY+60,20,20); //nose
  ellipse(posX+35,posY+25,50,50); //R-eye
  ellipse(posX-35,posY+25,50,50); //L-eye
  noFill();
  arc(posX,posY,195,195,HALF_PI-PI/8,HALF_PI+PI/8);
  arc(posX,posY,220,220,HALF_PI-PI/8+PI/48,HALF_PI+PI/8-PI/48);
  line(posX-20,posY+85,posX-23,posY+105);
  line(posX,posY+85,posX,posY+110);
  line(posX+20,posY+85,posX+23,posY+105);
  //book
  strokeWeight(3);
  stroke(100); //lncolorGray
  arc(5,400,16,50,HALF_PI,3*PI/2);
  line(8,0,8,375);
  line(8,375,300,375);
  line(7,380,300,380);
  line(6,385,300,385);
  line(5,390,300,390);
  line(4,395,300,395);
}

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

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