xxxxxxxxxx
87
let a;
let b;
function setup() {
createCanvas(600, 600);
//noLoop();
}
function draw() {
background(0);
//drawing ended up too small after I decided to focus on the face, so I'm
//scaling it to fit the canvas
scale(1.5);
//reflection - combination of the elements,
// has to come before for the blur filter to work
colorMode(HSB);
noStroke();
fill(25, 50, 255);
ellipse(100, 90, 100, 125);
colorMode(RGB);
fill(255, 0, 0);
triangle(95, 110, 115, 110, 120, 150);
fill(0, 175, 0);
ellipse(80, 65, 20, 20);
ellipse(120, 60, 20, 20);
colorMode(HSB);
fill(20, 75, 50);
quad(75, 35, 70, 15, 150, 20, 125, 40);
noStroke();
colorMode(RGB);
fill(100);
triangle(90, 150, 115, 150, 100, 175);
//blur the reflection
filter(BLUR, 10);
//mirror
stroke(230, 230, 100);
strokeWeight(5);
noFill();
quad(30, 15, 200, 5, 175, 150, 10, 200);
//head
colorMode(HSB);
noStroke();
fill(25, 50, 255);
ellipse(300, 100, 100, 125);
fill(0);
ellipse(250, 125, 40, 20);
ellipse(260, 75, 30, 40);
//eye
fill(255);
arc(310, 75, 75, 100, PI - 0.3, PI + 0.3);
colorMode(RGB);
fill(0, 175, 0);
arc(273, 75, 20, 20, PI + HALF_PI, PI - HALF_PI, PIE);
fill(0);
ellipse(272, 75, 10, 10);
//tongue
stroke(255, 0, 0);
strokeWeight(7);
curve(500, 200, 269, 125, 225, 160, 200, 250);
//hair
colorMode(HSB);
stroke(20, 75, 50);
strokeWeight(2);
a = 270;
b = 45;
for (let i = 0; i < 25; i++) {
line(a, b, a + 1, b - 30);
a += 3;
b += 1;
}
//beard
noStroke();
colorMode(RGB);
fill(100);
triangle(265, 145, 250, 200, 275, 155);
}