Yingyang Zhou-Project-01-Face

portrait

//Yingyang Zhou
//Section A
//yingyanz@andrew.cmu.edu
//project-01

function setup() {
    createCanvas(600, 600);
}

function draw() {

    //background
    background(255, 106, 106);
    if (mouseX > (width / 2)) {
      background(104, 150, 255);
    }

    //eyes
    fill(244, 147, 10);
    stroke(0);
    strokeWeight(0);
    ellipse(150, 220, 120, 100);
    ellipse(450, 270, 130, 100);
    fill(270, 170, 30);
    stroke(0);
    strokeWeight(0);
    ellipse(150, 220, 90, 80);
    ellipse(450, 270, 98, 80);

    //mouth
    ellipse(250, 500, 100, 20);
    fill(216, 41, 49);
    strokeWeight(0);
    ellipse(250, 500, 90, 17);

    //eyeball
    fill("grey")
    ellipse(158, 203, 30, 30);
    ellipse(465, 255, 30, 30);

    //nose
    fill(180, 180, 0);
    stroke(0);
    strokeWeight(0);
    triangle(mouseX, mouseY, mouseX - 15, mouseY - 60, mouseX - 30, mouseY );
    stroke(0);
    strokeWeight(2);


    //hair
    line(200, 0, 200, 50);
    line(210, 0, 210, 48);
    line(220, 0, 220, 45);
    line(230, 0, 230, 40);
    line(240, 0, 240, 52);
    line(250, 0, 250, 47);
    line(260, 0, 260, 48);
    line(270, 0, 270, 49);
    line(280, 0, 280, 45);
    line(290, 0, 290, 51);
    line(300, 0, 300, 50);
    line(310, 0, 310, 48);
    line(320, 0, 320, 45);
    line(330, 0, 330, 40);
    line(340, 0, 340, 52);
    line(350, 0, 350, 47);
    line(360, 0, 360, 48);
    line(370, 0, 370, 49);
    line(380, 0, 380, 45);
    line(390, 0, 390, 51);
    fill(50, 0, 2);
    ellipse(0, 300, 40, 600);
    ellipse(600, 300, 55, 700);
    ellipse(20, 20, 50, 270);
    ellipse(30, 0, 200, 30);
    ellipse(470, 0, 170, 50);
    ellipse(580, 20, 250, 70);
    ellipse(300, 0 ,2000, 20);

    //eyebrow
    fill(50, 50, 50);
    quad(93, 47, 95, 22, 205, 64, 212, 89);
    quad(423, 120, 427, 100, 548, 77, 548, 95);

    //glasses
    rotate(PI/55);
    noFill();
    stroke(50, 0, 2);
    strokeWeight(0.5);
    rect(60, 200, 180, 170,20);
    rect(390, 220, 180, 170, 20);
    line(240, 280, 390, 290);

    //earrings
    arc(0, 520, 200, 200, PI, PI + QUARTER_PI);

}

Red embarrassed face means that you put my nose in WRONG place.

When you see a blue happy face, my nose is generally in the RIGHT place.

Leave a Reply