วันพุธที่ 20 สิงหาคม พ.ศ. 2557

Lab 1 - Hope and Dream (with Variable)

Increase/Decrease Left_M for move a man to right/left.
Increase/Decrease Left_M for move a woman to right/left.

From Lab-0. It has space between us.
I feel lonely. I miss her.
So I'll go to right and make her to left.
So we'll nearly and don't feel alone.

Here is my coding

void setup()
{
  //variable
  int Left_M,Left_F;
  //assign variable
  Left_M = 60; //inc = man to right , dec = man to left
  Left_F = -60; //inc = woman to right , dec = woman to left
  size(500,300);
  background(134,255,74);
  noStroke();
  //Draw man
  fill(255,214,156); //face
  ellipse(Left_M+150,100,30,30); //face
  fill(0); //hair
  beginShape(); //hair
  vertex(Left_M+133,95);//1
  bezierVertex(Left_M+138,82,Left_M+162,82,Left_M+167,95); //2
  vertex(Left_M+133,95);//3
  endShape();

  fill(0,151,252); //shirt
  beginShape(); //shirt
  vertex(Left_M+135,115); //1
  vertex(Left_M+165,115); //2
  vertex(Left_M+190,140); //3
  vertex(Left_M+180,150); //4
  vertex(Left_M+165,135); //5
  vertex(Left_M+165,180); //6
  vertex(Left_M+135,180); //7
  vertex(Left_M+135,135); //8
  vertex(Left_M+120,150); //9
  vertex(Left_M+110,140); //10
  vertex(Left_M+135,115); //11,1
  endShape();
  fill(20,25,33); //jeans
  beginShape(); //jeans
  vertex(Left_M+165,180); //1
  vertex(Left_M+170,245); //2
  vertex(Left_M+155,245); //3
  vertex(Left_M+150,200); //4
  vertex(Left_M+145,245); //5
  vertex(Left_M+130,245); //6
  vertex(Left_M+135,180); //7
  endShape();

  //Draw woman
  fill(255,214,156); //face
  ellipse(Left_F+350,100,30,30); //face
  fill(255,0,238); //shirt
  beginShape(); //shirt
  vertex(Left_F+335,115); //1
  vertex(Left_F+365,115); //2
  vertex(Left_F+390,140); //3
  vertex(Left_F+380,150); //4
  vertex(Left_F+365,135); //5
  vertex(Left_F+365,180); //6
  vertex(Left_F+335,180); //7
  vertex(Left_F+335,135); //8
  vertex(Left_F+320,150); //9
  vertex(Left_F+310,140); //10
  vertex(Left_F+335,115); //11,1
  endShape();
  fill(0); //hair
  beginShape(); //hair
  vertex(Left_F+360,93); //1
  vertex(Left_F+340,93); //2
  vertex(Left_F+340,125); //3
  vertex(Left_F+330,125); //4
  vertex(Left_F+330,93); //5
  bezierVertex(Left_F+335,72,Left_F+365,72,Left_F+370,93); //6
  vertex(Left_F+370,125); //7
  vertex(Left_F+360,125); //8
  vertex(Left_F+360,93); //9
  endShape();
  fill(20,25,33); //skirt
  beginShape(); //skirt
  vertex(Left_F+365,180); //1
  vertex(Left_F+380,245); //2
  vertex(Left_F+320,245); //3
  vertex(Left_F+335,180); //4
  endShape();

  //Draw HEART !!
  beginShape();
  fill(255,0,0);
  vertex(250,100); //1
  bezierVertex(200,60,220,20,250,40);
  bezierVertex(280,20,300,60,250,100);
  endShape();