gyueunp – Project-02: Variable Faces

variable face

// GyuEun Park
// 15-104 E
// gyueunp@andrew.cmu.edu
// Project-02

var eyeSize = 14;
var blushTransp = 0;
var colorR = 112;
var colorG = 104;
var colorB = 104;
var eyebrowTransp = 0;

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

function draw() {
	background(colorR,colorG,colorB);

	// ears
	fill(0);
	noStroke();
	ellipse(175,125,20,30);
	ellipse(305,125,20,30);

	// head and neck
	fill(252,252,248);
	ellipse(width/2,320,280,440);
	
	// face
	fill(240,234,227);
	ellipse(width/2,230,170,200);

	// eyes
	fill(70);
	ellipse(200,230,eyeSize,eyeSize);
	ellipse(280,230,eyeSize,eyeSize);

	//blush
	fill(246,179,167,blushTransp);
	ellipse(190,245,15,6);
	ellipse(290,245,15,6);

	// nose
	stroke(100);
	strokeWeight(2);
	line(235,255,240,260);
	line(245,255,240,260);

	//philtrum
	stroke(100);
	strokeWeight(2);
	line(width/2,260,width/2,275);

	//eyebrows
	stroke(100,eyebrowTransp)
	line(200,215,210,218);
	line(280,215,270,218);

	fill(178,191,199);
	noStroke(0);
	ellipse(230,282,4,4);

	fill(255);
	noStroke(0);
	ellipse(229,281.4,1.5,1.5);
}

function mousePressed() {
	// when the user clicks, these variables are reassigned to random values within specified ranges.
	eyeSize = random(10,20);
	blushTransp = random(0,100);
	colorR = random(100,112);
	colorG = random(100,104);
	colorB = random(100,104);
	eyebrowTransp = random(0,100);
}

I made a face of my new stuffed alpaca. Although the random changes were interesting, I wanted to avoid drastic alterations. Therefore, I focused on creating subtle color and transparency changes in the background and its facial features.

Leave a Reply