Jasmine Lee – Project 02 – Variable Face

bear

//Jasmine Lee
//Section C
//jasmine4@andrew.cmu.edu
//Project-02 (Variable Faces)

var wind = 10;
var windv = 10;
var r = 210;
var g = 134;
var b = 50;
var bodyx = 250;
var bodyy= 300;
var underbelly = 60;
var earx = 100;
var eary = 100;
var headx = 220;
var heady = 220;
var eyesize = 5;
var browtilt = 10;

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

function draw() {
    background (189, 238, 255);

    //cloud-left
    noStroke();
    fill(255, 255, 255);
    ellipse(140 + wind, 230 + windv, 230, 60);
    ellipse(60 + wind, 210 + windv, 45, 40);
    ellipse(100 + wind, 210 + windv, 60, 80);
    ellipse(150 + wind, 210 + windv, 80, 95);
    ellipse(190 + wind, 210 + windv, 60, 65);
    ellipse(230 + wind, 210 + windv, 30, 20);
    ellipse(75 + wind, 247 + windv, 70, 30);
    ellipse(150 + wind, 253 + windv, 100, 32);
    ellipse(215 + wind, 245 + windv, 50, 23);

    //cloud-right
    noStroke();
    fill(255, 255, 255);
    ellipse(540 - wind, 230 - windv, 230, 60);
    ellipse(460 - wind, 210 - windv, 45, 40);
    ellipse(500 - wind, 210 - windv, 60, 80);
    ellipse(550 - wind, 210 - windv, 80, 95);
    ellipse(590 - wind, 210 - windv, 60, 65);
    ellipse(630 - wind, 210 - windv, 30, 20);
    ellipse(475 - wind, 247 - windv, 70, 30);
    ellipse(550 - wind, 253 - windv, 100, 32);
    ellipse(615 - wind, 245 - windv, 50, 23);

    //body
    noStroke();
    fill(r, g, b);
    ellipse(320, 470, bodyx, bodyy);

    //bodywhite
    noStroke();
    fill(255, 255, 255);
    ellipse(320, 470, bodyx - underbelly, bodyy - underbelly);

    //ears
    noStroke();
    fill(r, g, b);
    ellipse(220, 200, earx, eary);
    ellipse(420, 200, earx, eary);

    //earwhites
    noStroke();
    fill(255, 255, 255);
    ellipse(215, 215, earx / 2, eary / 2);
    ellipse(435, 215, earx / 2, eary / 2);

    //head
    noStroke();
    fill(r, g, b);
    ellipse(320, 270, headx, heady);

    //eyes
    noStroke();
    fill(0);
    ellipse(250, 280, 35 + eyesize, 35 - eyesize);
    ellipse(390, 280, 35 + eyesize, 35 - eyesize);
    
    //eyeshine
    noStroke();
    fill(255, 255, 255);
    ellipse(260, 270, 15, 15);
    ellipse(400, 270, 15, 15);
    ellipse(265, 280, 5, 5);
    ellipse(405, 280, 5, 5);

    //nose
    noStroke()
    fill(255, 209, 216);
    ellipse(320, 300, 30, 5);

    //mouth
    stroke(1);
    fill(0);
    line(310, 340, 330, 330);
    line(330, 340, 310, 330);

    //eyebrows
    stroke(1);
    fill(0);
    line(230, 245, 280, 245 + browtilt);
    line(410, 245, 360, 245 + browtilt);
}

function mousePressed() {
    wind = random(10, 100);
    windv = random(10, 100);
    r = random(210, 180);
    g = random(134, 150);
    b = random(33, 112);
    bodyx = random(250, 300);
    bodyy = random(330, 350);
    underbelly = random(80, 120);
    earx = random(120, 140);
    eary = random(100, 120);
    headx = random(235, 270);
    heady = random(220, 250);
    eyesize = random(1, 5);
    browtilt = random(-15, 15);
}

For this assignment, I had fun creating a teddy bear. I think they’re very cute as stuffed animals and wanted to recreate one whose expressions could change from angry to sad.

Leave a Reply