Kimberlyn Cho- Project 02- Variable Face

I decided to draw a hotdog because of a sudden late night craving. After a few iterations of different hotdogs, I focused on varying the droopiness of the eyelids to portray a sleepy hotdog. 

variable

/* Kimberlyn Cho
Section C
ycho2@andrew.cmu.edu
Assignment-02 */

//background
var R = 179;
var G = 236;
var faceHeight = 700;
var droop = 180;
var mouthW = 60;
var mouthH = 10;

function setup() {
    createCanvas(640, 480);
}

function draw() {
    //background
    background(R, G, 255);

    //face
    strokeWeight(5);
    fill(255, 121, 92);
    ellipse(320, 480, 350, faceHeight);

    //hands
    fill(255, 204, 102);
    ellipse(320 - 175, 225 + faceHeight * 0.4, 150, 200);
    ellipse(320 + 175, 225 + faceHeight * 0.4, 150, 200);

    //eyes
    strokeWeight(0);
    fill("white");
    var eyeLX = width / 2 - 350 * 0.15;
    var eyeRX = width / 2 + 350 * 0.15;
    var eyeLY = 480 - faceHeight * 0.3;
    ellipse(eyeLX, eyeLY, 40, 60);
    ellipse(eyeRX, eyeLY, 40, 60);
    fill("black");
    ellipse(eyeLX, eyeLY, 25, 50);
    ellipse(eyeRX, eyeLY, 25, 50);

    //eyelids
    strokeWeight(3);
    fill("green");
    arc(eyeLX, eyeLY, 45, 70, droop, 0, OPEN);
    arc(eyeRX, eyeLY, 45, 70, droop, 0, OPEN);

    //mouth
    strokeWeight(0);
    fill("yellow");
    ellipse(320, 480 - faceHeight * 0.15, mouthW * 3, mouthH * 6);
    fill("red");
    ellipse(320, 480 - faceHeight * 0.15, mouthW * 2, mouthH * 4);
    fill("white");
    ellipse(320, 480 - faceHeight * 0.15, mouthW, mouthH);


}

function mousePressed() {
    //background
    R = random(150, 200);
    G = random(200, 250);
    faceHeight = random(600, 780);
    droop = random(HALF_PI + QUARTER_PI, PI + QUARTER_PI);
    mouthW = random(50, 70);
    mouthH = random(5, 15);

}

 

Leave a Reply