Project 1: My Self Portrait

beans-sketch

//Yeon Lee, Section C
//Project 01: Self-Portrait (Face)

function setup() {
    createCanvas(600, 500);
    background(255, 192, 203);
}

function draw() {
    noStroke();

    //hair
    fill(32, 20, 7);     
    rect(165, 210, 270, 300);
    ellipse(300, 220, 270, 270);

    //shoulder
    fill(251, 206, 158);    
    rect(150, 450, 300, 140);
    ellipse(300, 450, 320, 50);

    //cloth
    fill(63, 146, 208);    
    rect(140, 470, 320, 100);
    ellipse(150, 475, 40, 100);
    ellipse(450, 475, 40, 100);

    //neck
	fill(251, 206, 158);    
    rect(270, 380, 60, 60);

    //ear
    ellipse(207, 280, 50, 50); 

    //side hair
    fill(32, 20, 7);   
    ellipse(200, 270, 10, 80); 

    //neck shadow
    fill(238, 189, 138);    
    ellipse(300, 380, 60, 40);

    //face
    fill(251, 206, 158);    
    ellipse(300, 260, 202, 250);

    //eyebrow
    fill(26, 15, 3);    
    arc(250, 250, 35, 13, PI, 0);
    arc(350, 250, 35, 13, PI, 0);
    
    //left eye
    fill(26, 15, 3);    
    ellipse(250, 280, 27, 32);
    fill(255, 255, 255);
    ellipse(255, 275, 7, 7);
    fill(238, 189, 138);
    arc(248, 298, 27, 10, PI, 0);

    //right eye
    fill(26, 15, 3);    
    ellipse(350, 280, 27, 32);
    fill(255, 255, 255);
    ellipse(355, 275, 7, 7);
    fill(238, 189, 138);
    arc(348, 298, 27, 10, PI, 0);
    
    //nose
    fill(238, 189, 138);    
    arc(300, 315, 20, 10, PI, 30);

    //mouth
    fill(216, 100, 100);    
	arc(300, 335, 50, 45, 0, PI, CHORD);

    //tongue
	fill(193, 66, 66);     
	ellipse(300, 348, 20, 10);

    //teeth
	fill(255, 255, 255);    
	ellipse(300, 335, 40, 5);

    //earring
    fill(255, 255, 255);    
    rect(199.5, 310, 1, 25);
    ellipse(200, 340, 10, 10);
    ellipse(200, 330, 7, 7);

    //front hair
    fill(32, 20, 7);     
    rect(168, 400, 35, 180);
    rect(395, 245, 40, 260);
    arc(190, 150, 270, 220, -0.2, HALF_PI);
    rotate(.80);
    translate(-180, -145)
    ellipse(580, 10, 150, 60);

    noLoop();
}

For this first project, it was quite challenging to work with arc(), PI/CHORD, rotate(), and translate() functions but it was really fun to explore with the codes. I had fun playing around with different colors and changing the sizes of the image I wanted to create.

Leave a Reply