//Christine Seo
//Section C
//mseo1@andrew.cmu.edu
//Project-01-Face
function setup() {
createCanvas(600, 600);
background(226, 213, 248);
}
function draw() {
// background color change
background (226, 213, 248); // lilac
if (mouseX < (width / 1.5)) {
background(0); // black
}
//backlight
fill(226, 213, 248);
strokeWeight(0);
ellipse(292,300,490,582);
//body shirt
fill(255, 235, 135);
strokeWeight(0);
rect(175, 325, 235, 235, 220, 315, 10, 10)
//neck
fill(250, 219, 129);
strokeWeight(0);
ellipse(295,355,47,47);
//face
fill(250,238,212);
strokeWeight(0);
ellipse(295,250,290,220);
//eyes black base
fill(158,133,83);
strokeWeight(2);
ellipse(227,255,47,47);
ellipse(357,255,47,47);
fill(0);
strokeWeight(0);
ellipse(227,250,49,49);
ellipse(357,250,49,49);
//eyelashes
strokeWeight(0);
fill(0);
ellipse(378,236,18,3);
strokeWeight(0);
fill(0);
ellipse(378,242,18,3);
strokeWeight(0);
fill(0);
ellipse(204,236,18,3);
strokeWeight(0);
fill(0);
ellipse(204,242,18,3);
//eyes whites
fill(999);
strokeWeight(0);
ellipse(239,250,8,8);
fill(999);
strokeWeight(0);
ellipse(369,250,8,8);
fill(999);
strokeWeight(0);
ellipse(222,240,12,12);
fill(999);
strokeWeight(0);
ellipse(354,240,12,12);
//nose
noFill();
strokeWeight(2);
curve(285, 332, 285, 261, 308, 260, 308, 296);
//mouth
noFill();
strokeWeight(3);
curve(280,160,330,310,250,310,250,160);
//bangs
strokeWeight(0);
fill(131,93,29);
rect(149,148,280,65,60);
strokeWeight(0);
fill(131,93,29);
ellipse(292,148,271,125);
//bangs triangle
fill(250,238,212);
strokeWeight(0);
triangle(210, 225, 228, 160, 236, 215);
//side bangs
fill(131,93,29);
strokeWeight(0);
ellipse(158,240,30,182);
fill(131,93,29);
strokeWeight(0);
ellipse(426,240,30,182);
//cheeks
fill(252, 192, 253,220);
strokeWeight(0);
ellipse(190,280,47,20)
fill(252, 192, 253,220);
strokeWeight(0);
ellipse(393,282,47,20)
//eyebrows
strokeWeight(0.5);
fill(127, 93, 48);
ellipse(365,216,38,4);
strokeWeight(0.5);
fill(120, 93, 40);
ellipse(218,216,38,4);
//shirt pocket
beginShape(TRIANGLE_STRIP);
strokeWeight(0);
fill(179, 213, 248);
vertex(245, 505);
vertex(275, 450);
vertex(285, 505);
vertex(295, 450);
vertex(305, 505);
vertex(315, 450);
vertex(345, 505);
endShape();
//arms
strokeWeight(0);
fill(250, 219, 129);
rect(180,410,40,145,60);
strokeWeight(0);
fill(250, 219, 129);
rect(365,410,40,145,60);
//ponytail
fill(131,93,29);
triangle(255, 15, 293, 100, 321, 15);
translate(width / 2.55, height / 6.6);
rotate(TWO_PI / -8);
beginShape();
fill(179, 213, 248);
vertex(20, 20);
vertex(40, 20);
vertex(40, 40);
vertex(60, 40);
vertex(60, 60);
vertex(20, 60);
endShape(CLOSE);
}
Although in the beginning I had a difficult time to locate each element to the coordinates I wanted, I successfully managed to bring out my characteristics in the self portrait. Since this was my first time coding, I had a lot of fun exploring different functions and elements!