// Ammar Hassonjee
// Section C
// ahassonj@andrew.cmu.edu
// Project-01
function setup() {
createCanvas(600, 600);
background(200);
}
function draw() {
//Drawing my shirt
stroke('navy');
fill('navy');
if (mouseX < width / 2) {
fill('black');
}
arc(300, 600, 500, 275, PI, 0);
//Making the neck
stroke('rgb(205, 161, 132)');
fill('rgb(205, 161, 132)');
quad(217, 470, 244, 400, 348, 400, 374, 470);
ellipse(295, 470, 155, 60);
//Forming the head
stroke('rgb(215, 165, 132)');
fill('rgb(215, 165, 132)');
ellipse(300, 280, 250, 300);
//Creating the Hair
stroke('black');
fill('black');
beginShape()
vertex(186, 215);
vertex(198, 153);
vertex(201, 161);
vertex(242, 107);
vertex(242, 127);
vertex(313, 90);
vertex(303, 111);
vertex(377, 100);
vertex(351, 117);
vertex(427, 118);
vertex(406, 140);
vertex(452, 126);
vertex(439, 157);
vertex(461, 156);
vertex(444, 185);
vertex(454, 187);
vertex(414, 215);
endShape();
//forming the ears
stroke('rgb(215, 165, 132)');
fill('rgb(215, 165, 132)');
beginShape();
vertex(180, 258);
vertex(161, 260);
vertex(151, 267);
vertex(165, 326);
vertex(180, 326);
endShape();
beginShape();
vertex(419, 258);
vertex(437, 260);
vertex(447, 267);
vertex(433, 326);
vertex(326, 326);
endShape();
//creating the eyes
noStroke();
fill('white');
ellipse(256, 266, 40, 30);
ellipse(346, 266, 40, 30);
noStroke();
fill('rgb(132, 100, 80)');
if (mouseIsPressed) {
fill('rgb(220, 5, 5)');
}
ellipse(256, 266, 20, 20);
ellipse(346, 266, 20, 20);
noStroke();
fill('white')
ellipse(250, 263, 5, 5);
ellipse(340, 263, 5, 5);
//shaping the mouth
stroke('rgb(229, 229, 229)');
fill('rgb(229, 229, 229)');
triangle(263, 377, 300, 388, 338, 377);
// forming the nose
stroke(132, 100, 80);
strokeWeight(2);
line(300, 281, 314, 338);
line(314, 338, 318, 345);
line(318, 345, 304, 350);
//eyebrows
noStroke();
fill('black');
triangle(226, 239, 277, 241, 278, 235);
triangle(324, 242, 324, 236, 375, 238);
}
My process for completing this portrait began with experimenting with the different functions of ps.j5 and learning how the variables controlled shapes like ellipses and curves. I then began to digitally sketch the kind of drawing I wanted and then used the same coordinates in other softwares to code accurate shapes.