Project 1: My portrait :)

mnumoto-01-project
function setup() {
    createCanvas(500, 400);
    background(255, 189, 233);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    stroke(0); //initialize stroke colour
    strokeWeight(3); //initialize stroke weight
    //think in layers, like on sketchbook/photoshop. neck is base, shoulders/chest and head above that... so neck first.
    fill(240, 201, 146); //skin colour
    rect(225, 250, 50, 60); //neck rectangle
    ellipse(250, 200, 100, 120); //face ellipse
    fill(148, 148, 148); //shirt colour
    rect(150, 303, 200, 100); //shoulders/chest rectangle
    fill(20, 13, 6); //hair colour
    rect(180, 180, 45, 180); //hair left
    rect(270, 180, 45, 180); //hair right
    triangle(183, 180, 250, 125, 225, 180); // top hair left
    triangle(315, 180, 250, 125, 220, 190); // top hair right
    fill(255); //colour for inside of glasses
    ellipse(275, 220, 40, 40); //glasses left
    ellipse(225, 220, 40, 40); // glasses right
    line(240, 220, 260, 220); //connector
    noLoop;
}

Leave a Reply