Jaclyn’s Variable Face

jsaik

/* Jaclyn Saik 
Project-02 
Section E 
*/


//face and hair variables 
var eyeSize = 20;
var pupilSize = 10
var faceWidth = 150;
var faceHeight = 170;
var bunWidth = 100
var bunHeight = 100
var armLW = 160
var armRW = 480
var toungeL = 40
var toothL = 10
var eyebrowH = 155
var bluehair = 50
var redskin = 238




    

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

function draw() {
    background(140, 120, 170);
    noStroke();

    //colors
    s = color(redskin, 216, 193) //skin
    r = color(206, 20, 110)
    b = color(223, 140, bluehair)

    //body
    fill(s)
    //arms
    
    triangle(245, (height / 2) + 20, 240, 380, armLW, 600);
    triangle(235 + (width / 4), (height / 2) + 20, 235 + (width / 4), 380, armRW, 600);
    fill(r)
    rect(240, height / 2, width / 4, height*(2/3), 20)

    //hair
    fill(b)
    ellipse(width / 2, height / 3 + 5, faceWidth + 20, faceHeight + 40)
    ellipse(width / 2 - faceWidth * .6, height / 3 + 50, bunWidth, bunHeight)
    ellipse(width / 2 + faceWidth * .6, height / 3 + 50, bunWidth, bunHeight)


    //face
    fill(s)
    ellipse(width / 2, height / 3 + 25, faceWidth,  faceHeight);
    //eyes
    var eyeLX = width / 2 - faceWidth * 0.25;
    var eyeRX = width / 2 + faceWidth * 0.25;
    var pupilLX = width / 2 - faceWidth * 0.25;
    var pupilRX = width / 2 + faceWidth * 0.25;
    fill(255);
    ellipse(eyeLX, height / 3 + 15, eyeSize, eyeSize); 
    ellipse(eyeRX, height / 3 + 15, eyeSize, eyeSize);
    fill(0)
    //pupils
    ellipse(eyeLX, height / 3 + 15, pupilSize, pupilSize); 
    ellipse(eyeRX, height / 3 + 15, pupilSize, pupilSize);
    
    
    //tounge
    fill(237, 106, 169)
    ellipse(width / 2, height / 3 + 65, 30, toungeL)
    //teeth
    fill(255)
    rect(width / 2 - 5, height / 3 + 60, 15, toothL)
    //mouth
    fill(s)
    rect(width / 2 - 25, height / 3 + 50, 50, 10)

    //nose
    var noseWL = 300
    var noseWR = 340
    fill(247, 208, 95)
    triangle(width / 2, height / 3 + 10, noseWL, height / 3 + 50, noseWR, height / 3 + 50);

    //eyebrows
    noFill();
    strokeWeight(3)
    stroke(218, 130, 55)
    arc(eyeLX, eyebrowH, 40, 25, PI*1.2, 0, OPEN)
    arc(eyeRX, eyebrowH, 40, 25, PI, TWO_PI*.9, OPEN)


    

}

function mousePressed() {
    
    faceWidth = random(125, 150);
    eyeSize = random(20, 50);
    pupilSize = random(10, 15)
    bunHeight = random(60, 120);
    bunWidth = random(60, 120);
    armLW = random(120, 200);
    armRW = random(440, 520);
    toungeL = random(30, 90);
    toothL = random(10, 17)
    eyebrowH = random(160, 145)
    bluehair = random(20, 200)
    redskin = random(100, 255)


 
}

This was an interesting task, and definitely very fun to research. I especially liked looking into how artists like Moka create algoritm-generated faces, and how the randomization tools of computers really highlight the odd ways our brains look and recognize facial expressions. Instead of working in a sketchbook, my main method of “sketching” for this project was first creating the static elements of my figure, so originally the arms and torso, and then playing with different features layered on top of each other to see what type of expressions come out. I found it especially interesting how much power the pupils and eyebrows have over a person’s expression.

Leave a Reply