xxxxxxxxxx
104
//Vivianna Mo
//Intro to IM - Shiloh
//Sept. 9 2022
//Assignment 1 - Self portrait
function setup() {
createCanvas(500, 500);
}
function draw() {
background(171, 241, 255);
noStroke();
//print(mouseX, mouseY);
//hair
fill(0);
rectMode(CENTER);
rect(width /2, 300, 270, 350);
//neck
fill(255, 217, 168);
rect(width / 2, 400, 90, 50); //neck
fill(214, 179, 133);
ellipse(width / 2, 380, 90, 60); //shading of the neck
//ears
fill(227, 194, 152);
ellipse(125, 255, 50, 70); //left ear
ellipse(375, 255, 50, 70); //right ear
//head
noStroke();
fill(255, 217, 168);
ellipse(width / 2, height / 2, 250, 280);
//bangs: did a lot of experimenting with different shapes and sizes, left it here just in case
fill(0);
// beginShape();
// vertex(255, 100);
// bezierVertex(367, 0, 370, 280, 380, 255);
// bezierVertex(350, 80, 450, 360, 200, 100);
// bezierVertex(200, 150, 150, 50, 50, 500);
// endShape();
// arc(310, 120, 140, 100, radians(40), radians(200), PIE);
// ellipse(250, 95, 245, 100); //top of the head
arc(250, 125, 270, 150, radians(180), radians(360), CHORD);
// ellipse(185, 140, 140, 100); //left bangs
// ellipse(315, 140, 140, 100); //right bangs
arc(145, 110, 220, 150, radians(340), radians(110), CHORD); //left bang
arc(395, 130, 300, 150, radians(110), radians(220), CHORD); //right bang
//eyes
fill(33, 17, 6);
ellipse(200, 250, 60, 70); //left eye
ellipse(300, 250, 60, 70); //right eye
noStroke();
fill(255);
ellipse(200, 228, 25); //left eye top circle
ellipse(300, 228, 25); //right eye top circle
// ellipse(195, 266, 35); //left eye bottom cirle
// ellipse(295, 266, 35); //right eye bottom circle
//eyebrows
fill(0);
stroke(0);
strokeWeight(3);
arc(200, 210, 55, 13, radians(180), radians(360), PIE); //left eyebrow
arc(300, 210, 55, 13, radians(180), radians(360), PIE); //right eyebrow
//nose
noStroke();
fill(214, 179, 133);
triangle(220, 300, 245, 260, 245, 320); //shading of the nose
strokeWeight(1.5);
stroke(176, 144, 102);
line(228, 315, 240, 320, 0, 0); //left nostril
line(250, 320, 260, 315, 0, 0); //right nostril
//mouth
noFill();
strokeWeight(2);
stroke(250, 146, 125);
arc(245, 325, 80, 50, radians(20), radians(160), OPEN);
//blush
noStroke();
if(mouseX > 125 && mouseX < 370) {
fill(240, 146, 139); //appears when hover over face at x coordinates
} else {
noFill();
}
ellipse(150, 305, 70, 30);
ellipse(350, 305, 70, 30);
colorMode(RGB);
//body
fill(245, 174, 152);
ellipse(width / 2, 510, 400, 175); //shirt
fill(255, 217, 168);
ellipse(width / 2, 425, 90, 20); //curve the neck to shirt
}