hdw – Project 1 – Face

helen’s-face

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

function draw() {
    background(255);

    //hair
    fill(0);
    noStroke();
    //arc(250,250,200,260,150,360);
    ellipse(250,250,202,250,150);

    //right hair
    noFill();
    stroke(0);
    strokeWeight(1);
    arc(399,265,100,190,100,180);
    arc(330,320,60,120,280,40);

    //face
    fill(255,232,200);
    noStroke();
    //ellipseMode(center)
    arc(250,250,200,210,180,360);
    arc(250,250,200,270,360,180);

    angleMode(DEGREES);

    //left hair cont
    noFill();
    stroke(0);
    strokeWeight(1);
    arc(130,180,100,150,340,100);
    arc(130,180,133,200,340,100);

    //blush
    if (mouseIsPressed) {
      fill(255,167,151,255);
      noStroke();
      ellipse(310,300,50,50);
      ellipse(190,300,50,50);
    } else {
      fill(255,167,151,150);
      noStroke();
      ellipse(310,300,50,50);
      ellipse(190,300,50,50);
    }

    //glasses
    fill(255,232,200,0);
    stroke(0);
    strokeWeight(1);
    ellipse(200,260,76,76);

    stroke(0);
    strokeWeight(1);
    arc(250,260,24,15,180,360);

    stroke(0);
    strokeWeight(1);
    ellipse(300,260,76,76);

    line(150,260,161,260);
    line(349,260,338,260);

    //eyes
    if (mouseIsPressed) {
      noFill();
      stroke(0);
      strokeWeight(2);
      arc(200,260,30,30,160,340);
      arc(300,260,30,30,200,20);
    } else {
      noFill();
      stroke(0);
      strokeWeight(2);
      arc(200,260,30,30,200,0);
      arc(300,260,30,30,180,340);
    }

    //nose
    noFill()
    stroke(255,131,122);
    strokeWeight(1);
    arc(250,300,30,30,20,160);

    //mouth
    if (mouseIsPressed) {
      fill(255,167,151);
      noStroke();
      ellipse(250,343,25,13);

      noFill();
      stroke(255,131,122,200);
      strokeWeight(2);
      arc(250, 325, 50, 36, 0, 180);

    } else {
      fill(255,167,151);
      noStroke();
      ellipse(250,343,25,13);

      noFill();
      stroke(255,131,122,200);
      strokeWeight(2);
      arc(250, 325, 50, 36, 20, 160);

    }

}

I’ve never coded before this class so I was worried about the project going in. After the preliminary Mondrian exercise, I was comfortable with playing around with code. I started by making some sketches on my sketchbook before I settled on a form I enjoyed, then changed some of it when I coded it.

I had a lot of fun making it, so after I finished I played around with it some more. After Wednesday’s lecture, I added a clickable function.

Leave a Reply