Project 1: Self Portrait

I wasn’t sure how to embed the sketch.js file so here’s the code itself:

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

function draw() {
background(240);
strokeWeight(3);
line(70,70,30,220);
line(30,220,140,210);
line(140,210,146,270);
line(146,270,175,267);
curve(175,267,190,150,180,140);
line(175,267,180,300);
//contour of nose and mouth
strokeWeight(2);
ellipse(70,70,80);
fill(0);
circle(80,80,25);
//right eyeball and pupil
fill(255)
ellipse(200,140,80);
fill(0);
circle(210,150,25);
//left eyeball and pupil
ellipse(90,200,50,10);
//nostril
noStroke();
fill(60,200,30);
rect(90,200,20,100);
circle(100,300,20);
fill(255);
circle(105,290,5);
//booger
arc(100,100,30,0,180);
//smile
fill(0);
rect(180,70,70,15);
rect(30,20,70,15);
//eyebrows
noLoop()

}

LO: My Inspiration

The Mondrian painting was fun to do because of how straight forward it was.
I did change the rect Mode to CORNERS just because I found it easier
to put the rectangles where I wanted it.
I found it really helpful to organize each line by
rectangle color so that I didn’t have to constantly
define the fill color on each line.

I wanted to make the self-portrait more dynamic but
I had trouble getting anything to work the way
I imagined.
At first I wanted the pupils to follow the mouse
but I couldn’t figure out how to keep the
pupils within the eyeball.
Then I thought it’d be cool to make the booger move up
and down with the mouse but again I couldn’t really
figure it out.