//Sarah Ransom
//Section C
//sransom@andrew.cmu.edu
//Self Portrait
var lefteyeHeight = 20
var righteyeHeight = 20
var faceHeight = 220
var noseHeight = 30
var mouthWidth = 30
function setup() {
createCanvas(640, 480);
background(255,204,150);
}
function draw() {
noStroke();
fill("brown");
ellipse(200,280,60,300); //ponytail in the background
noStroke();
fill(255, 240, 173);
ellipse(200,250,200,faceHeight); //face
noStroke();
fill("brown");
arc(200, 230, 200, 180, PI, TWO_PI, OPEN); //bangs
noStroke();
fill("brown");
ellipse(200,140,50,50); //"ponytail bump"
noStroke();
fill('#222222');
ellipse(160,250,lefteyeHeight,30); // left eye
noStroke();
fill('#222222');
ellipse(240,250,righteyeHeight,30); // right eye
noStroke();
fill("red");
arc(200,280,noseHeight,40,0,PI); // nose
noFill();
stroke(0);
strokeWeight(3);
arc(210,320,mouthWidth,10,0,HALF_PI); //mouth
noFill();
stroke(0);
strokeWeight(2);
arc(160,265,20,7,0,PI); // left eye bag
noFill(); // right eye bag
stroke(0);
strokeWeight(2);
arc(240,265,20,7,0,PI);
}
function mousePressed() {
lefteyeHeight = random(10,50);
righteyeHeight = random(10,50);
noseHeight = random(20,40);
mouthWidth = random(10,70);
}
I wanted to avoid changing the head size since it fit perfectly with the hair so, instead, I went for making the facial features as variable as possible without changing their original colors. This resulted in eyes that change size independently of each other as well as the width of the nose and mouth changing at random.