Cody-portraitDownload
function setup() {
createCanvas(600,600);
background(220);
text("p5.js vers 0.9.0 test.", 10, 15);
}
function draw() {
background(150,150,150);
ellipse((width/2),(height/2), 400,500);
ellipse(225,220,80,40) //orbit left
fill(0)
ellipse(225,220,37,37) //eyeball left
fill(255)
ellipse(375,220,80,40) //orbit right
fill(0)
ellipse(375,220,37,37) //eyeball right
fill(255,0,0)
arc((width/2), 420, 150, 100, 0, 3.14) //mouth
fill(255,192,203)
triangle(300, 280, 280, 350, 320, 350) //nose
fill(255)
stroke(0,0,150)
strokeWeight(6)
arc(225, 200, 80, 40, 3.2, -0.04) //eyebrow left
arc(375, 200, 80, 40, 3.2, -0.04) //eyebrow right
stroke(0)
line(300, 50, 80, 300) //hair left
line(300, 50, 80, 290)
line(300, 50, 90, 280)
line(300, 50, 90, 270)
line(300, 50, 95, 260)
line(300, 50, 95, 250)
line(300, 50, 100, 240)
line(300, 50, 100, 230)
line(295, 50, 100, 220)
line(290, 50, 100, 210)
line(285, 50, 100, 200)
line(280, 50, 100, 200)
line(275, 50, 100, 190)
line(270, 50, 100, 190)
line(265, 51, 100, 180)
line(260, 51, 100, 180)
line(250, 53, 100, 175)
line(240, 54, 100, 175)
line(230, 55, 100, 175)
line(300, 50, 520, 300) //hair right
line(300, 50, 520, 290)
line(300, 50, 510, 280)
line(300, 50, 510, 270)
line(300, 50, 505, 260)
line(300, 50, 505, 250)
line(300, 50, 500, 240)
line(300, 50, 500, 230)
line(305, 50, 500, 220)
line(310, 50, 500, 210)
line(315, 50, 500, 200)
line(320, 50, 500, 200)
line(325, 50, 500, 190)
line(330, 50, 500, 190)
line(335, 51, 500, 180)
line(340, 51, 500, 180)
line(350, 53, 500, 175)
line(360, 54, 500, 175)
line(370, 55, 500, 175)
line(235,47,365,47) //hair middle
line(233,49,368,49)
line(231,51,369,51)
line(230,53,370,53)
line(237,45,363,45)
arc(100, 310, 50, 60, 1.5, 4.75) //ear left
arc(500, 310, 50, 60, 4.75, 1.65) //ear left
noLoop();
}
Drawing my hair takes a long time because I have a unique hairstyle, but it’s been entertaining. I really enjoyed the process.