Project 1: My Self Portrait

This is my project.

sketch_selfportrait-SL
function setup() {
    createCanvas(800, 720);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    background(247, 221, 235)
    noStroke()

    // hair
    fill(38, 23, 8)
    ellipse(400, 450, 500, 650)

    // face
    fill(235, 190, 143)
    ellipse(400, 420, 300, 400)

    // ears
    circle(250, 400, 50)
    circle(550, 400, 50)

    // neck
    rect(358, 600, 90, 300)

    // nose
    stroke(255, 222, 179)
    strokeWeight(4)
    triangle(382, 475, 400, 420, 418, 475)

    // ear holes
    noStroke()
    fill(0, 0, 0)   
    circle(245, 400, 12, 12) 
    circle(555, 400, 12, 12)

    // earrings
    fill(175, 23, 104)   
    circle(246, 420, 5, 5) 
    circle(554, 420, 5, 5)

    // eyebrows
    noFill()
    stroke(38, 23, 8)
    arc(330, 377, 80, 70, (5 * PI) / 4, (7 * PI) / 4)
    arc(470, 377, 80, 70, (5 * PI) / 4, (7 * PI) / 4)

    // bangs
    fill(38, 23, 8) 
    arc(270, 230, 240, 250, -.18, HALF_PI + QUARTER_PI, OPEN)
    arc(480, 240, 200, 180, QUARTER_PI, -2.5, OPEN)

    // mouth
    fill(255, 255, 255)
    stroke(255, 0, 0)
    strokeWeight(6)
    arc(400, 510, 75, 75, 0, PI, CHORD)
    stroke(0)
    strokeWeight(1.5)
    line(370.2, 526.5, 429.8, 526.5)
	
    // eyes (outer)
    arc(330, 385, 48, 48, PI, 0, CHORD)
    arc(470, 385, 48, 48, PI, 0, CHORD)

    // upper body    
    fill(102, 0, 51)
    square(250, 660, 300)

    //eyeballs
    fill(75, 45, 14)
    circle(330, 373, 20, 20)
    circle(470, 373, 20, 20)
    noStroke()
    fill(0, 0, 0)
    circle(330, 373, 8.5, 8.5)
    circle(470, 373, 8.5, 8.5)
    fill(255, 255, 255)
    circle(333, 375, 4, 4)
    circle(473, 375, 4, 4)
}

Leave a Reply