serinal — self portrait (project 1)

sketch

//Serina Liu
//Section C
//serinal@andrew.cmu.edu
//Project-01
function setup() {
    createCanvas(600, 700);
    background(165, 203, 250);
    }

function draw() {

    strokeWeight(0)
    fill(107, 156, 185)
    rect (0, 605, 600, 80);

    strokeWeight(0)
    fill(107, 156, 185)
    rect (0, 500, 600, 80);

    strokeWeight(0)
    fill(107, 156, 185)
    rect (0, 390, 600, 80);

    strokeWeight(0)
    fill(107, 156, 185)
    rect (0, 280, 600, 80);
   
    strokeWeight (0) //hair upper
    fill (0 , 0 , 0)
    ellipse (300, 300, 420, 420);

    strokeWeight (0) //hair lower
    fill (0, 0, 0)
    rect (91, 300, 419, 290);

    strokeWeight (0) //head
    fill (255, 195, 170)
    ellipse (300, 300, 360, 360);

    strokeWeight (0) //nose
    fill (197, 151, 131)
    rect (290, 270, 10, 85);

    strokeWeight (0) //eye1
    fill (0, 0, 0)
    ellipse (220, 300, 30, 30);

    strokeWeight (0) //eye2
    fill (0, 0, 0)
    ellipse (370, 300, 30, 30);

    strokeWeight (0) //smile
    fill (256, 256, 256)
    arc (297, 389 , 80, 80, 0, PI, CHORD);

    strokeWeight (0) //smile interior mouth
    fill (0, 0, 0)
    arc (297, 395 , 80, 70, 0, PI, CHORD);

    strokeWeight (4) //glasses1
    fill (256, 256, 0, 20)
    ellipse (370, 300, 100, 100);

    strokeWeight (4) //glasses2
    fill (256, 256, 0, 20)
    ellipse (220, 300, 100, 100);

    strokeWeight (0)
    fill (0, 0, 0)
    rect (420, 300, 90, 10);

    strokeWeight (0)
    fill (0, 0, 0)
    rect (110, 300, 60, 10);

    strokeWeight (0)
    fill (0, 0, 0)
    rect (269, 300, 50, 10);

    strokeWeight (0)
    fill (255, 195, 170)
    rect (260, 470, 80, 60);

    strokeWeight (0)
    fill (255, 195, 170)
    ellipse (300, 670, 300, 300);

    strokeWeight (0)
    fill (153, 16, 21)
    ellipse (300, 690, 350, 350);

    strokeWeight (0)
    fill (255, 195, 170)
    arc (300, 514, 80, 80, 0, PI, CHORD);

    strokeWeight (0)
    fill (256, 256, 256)
    ellipse (375, 300, 20, 20);

    strokeWeight (0)
    fill (256, 256, 256)
    ellipse (225, 300, 20, 20);

    strokeWeight (5)
    noFill();
    arc(220, 315, 60, 60, HALF_PI+HALF_PI, PI);

    strokeWeight (5)
    noFill();
    arc(370, 315, 60, 60, HALF_PI+HALF_PI, PI);

    strokeWeight (0)
    fill (0, 0, 0)
    rect (187, 314, 65, 5);

    strokeWeight (0)
    fill (0, 0, 0)
    rect (338, 314, 65, 5);

    strokeWeight (0)
    fill (197, 151, 131) 
    triangle(276, 360, 295, 310, 313, 360);

    stroke(0,0,0)
    strokeWeight(3);
    fill(0);
    arc(220, 246, 60, 15, PI, TWO_PI);

    stroke(0,0,0)
    strokeWeight(3);
    fill(0);
    arc(372, 246, 60, 15, PI, TWO_PI);
    }

I have never coded before this class, so it took my some getting use to. The practice with the Mondrian definitely helped and made me a lot more comfortable with working with rectangular shapes. The arcs and the triangles took me a little time to figure out, but after Wednesday’s class, there was a nice guideline on the p5js site that ended up proving to be really really helpful. I think it turned out pretty well for a first attempt and I am looking forward to learning more ways to manipulate it/make it more detailed.

Leave a Reply