Katie Polhemus Project 02 variables face

pup face

/*
Katie Polhemus
Section A
kpolhemu@andrew.cmu.edu
project-02
*/

//pup face variables

	//background colors
var cR = 230;
var cG = 114;
var cB = 154;
	//ears
var earsSize = 150
	//head
var headWidth = 320;
var headHeight = 240;
	//eyes
var eyesSize = 30
	//snout
var snoutWidth = 350;
var snoutHeight = 180;
	//nose
var noseSize = 50
	//nose line
var noseLine = 10
	//mouth
var mouthSize = 50

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

function draw() {
	noStroke();
	background(cR, cG, cB);

	//left ear
	fill(145, 130, 99);
	ellipse(width/2 - noseSize * 2, height/2 + noseSize, earsSize, earsSize * 2);

	//right ear
	fill(145, 130, 99);
	ellipse(width/2 + noseSize * 2, height/2 + noseSize, earsSize, earsSize * 2);

	//head
	fill(154, 142, 109);
	ellipse(width/2, height/2, headWidth, headHeight);

	//eyes
	fill(0);
	var eyeLX = width / 2 - headWidth * 0.25
	var eyeRX = width / 2 + headWidth * 0.25
	ellipse(eyeLX, height/2 - eyesSize, eyesSize, eyesSize * 2);
	ellipse(eyeRX, height/2 - eyesSize, eyesSize, eyesSize * 2);

	//snout
	fill(74, 61, 35);
	ellipse(width/2, height/2 + noseSize, snoutWidth, snoutHeight);

	//nose
	fill(0);
	ellipse(width/2, height/2, noseSize, noseSize);

	//nose line
	stroke(0);
	strokeWeight(noseLine);
	line(headWidth, headHeight, headWidth, headHeight + eyesSize);

	//mouth
	fill(0);
	arc(width/2, height/2 + mouthSize, mouthSize, mouthSize * 2, 0, PI);	

}

function mousePressed() {
	cR = random(210, 250);
	cG = random(100, 130);
	cB = random(130, 170);
	mouthSize  = random(30, 70);
	earsSize = random(130, 170);
	eyesSize = random(25, 40);
}

Initially, my love for dogs motivated me to draw a dog’s face instead of a human’s, and ultimately, I found it much easier to draw a dog’s face than a human’s (based on project-01.) I think dogs can be very expressive, and I tried to convey that with movement of the eyes, ears, and mouth.

Leave a Reply