Project 1: My Self-Portrait

sketch

function setup() {
    createCanvas(200, 200);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    background(255, 192, 203);
    fill(59,25,7);
    rect(64,95,75,100); //hair
    fill(241, 194, 125);
    rect(90,135,20,20); //neck
    fill(255,235,238);
    rect(50,150,100,100); //body
    fill(241, 194, 125);
    ellipse(100, 100, 80, 80); //head
    fill(59,25,7);
    arc(62, 55, 60, 60, 0, PI / 2.0); //left bang
    fill(59,25,7);
    rect(92,56, 50,20); //right bang
    fill(59,25,7);
    rect(132,76,10,74); //strand
    fill(255,255,255);
    ellipse(75, 100, 30, 30); //left eye
    fill(255,255,255);
    ellipse(115, 100, 30, 30); //right eye
    fill(0,0,0);
    ellipse(75, 100, 10, 10); //left pupil
    fill(0,0,0);
    ellipse(115, 100, 10, 10); //right pupil
    stroke(0,0,0);
    fill(236,170,70);
    triangle(95,110,90,120,100,120); //nose
    noFill();
    arc(100, 110, 40, 40, 0, PI / 2.0); //mouth
}

I found it difficult to figure out arcs. My self-portrait is ugly-cute.

Leave a Reply