xxxxxxxxxx
125
let w = 400; h = 400; angle1 = 0; angle2 = 0; angle3 = 0;
function setup() {
createCanvas(w, h);
background("#F2AABC");
}
function draw() {
// Background arch drawing
noFill();
stroke(108, 186, 201);
strokeWeight(100);
arc(0, 0, 500, 500, angle1+PI, angle1);
angle1 += radians(1);
noStroke()
// Hair (behind the face)
fill("black");
ellipse(7*w/8, h/2 + 10, w/3, h/3);
ellipse(7*w/8 - 30, h/2 - 60, w/3, h/3);
ellipse(387, 150, w/8, h/8);
rect(w/2, h/2, w, h);
// Neck
fill("#F9E179");
triangle(w/2, h/4, w/4, 3*h/4, 3*w/4, 3*h/4);
fill("#D36332");
triangle(w/2, h/4, 3*w/8, h/2, 11*w/16, 5*h/8); // shadow on the neck
// Head
fill("#F9E179");
arc(w/2, h/4, w/2, h/2, 0, PI);
// Ear
arc(w/2, h/2 - 10, w/8, h/8, 0, PI);
// Lips
fill(232, 112, 133);
ellipse(3*w/8, h/4, w/32, h/32);
ellipse(3*w/8 - w/32 + 3, h/4, w/32, h/32);
triangle(3*w/8 - w/32 + 3 - w/64, h/4, 3*w/8 + w/64, h/4, 3*w/8, 5*h/16);
// Eyes - the other
fill("#D36332"); // glasses
quad(232, 117, 195, 137, 210, 194, 265, 170);
fill(242, 170, 188);
ellipse(216, 149, 20, 20);
fill("white");
translate(223, 150);
rotate(radians(-10));
ellipse(0, 0, 20, 50);
resetMatrix();
fill(106, 186, 201);
ellipse(222, 148, 15, 15);
fill("black");
ellipse(222, 148, 10, 10);
fill("white");
ellipse(222, 146, 3, 3);
fill("black");
translate(223, 150);
rotate(radians(-10));
arc(0, 0, 20, 50, 3*PI/2, PI/2); // eyelids
resetMatrix();
// Eyes - top
fill("white");
ellipse(216, 94, 20, 20);
fill(242, 170, 188);
ellipse(210, 101, 20, 20);
fill(106, 186, 201);
ellipse(215, 94, 15, 15);
fill("black");
ellipse(215, 94, 10, 10);
fill("white");
ellipse(217, 93, 3, 3);
// Hair (on top of the face)
fill("black");
beginShape();
vertex(5*w/8, h/4 - 10);
vertex(2*w/3, 3*h/8);
vertex(2*w/3 + 10, 3*h/8 + 10);
vertex(2*w/3 - 5, 3*h/8 + 15);
vertex(244, 190);
vertex(289, 277);
vertex(357, 277);
vertex(301, 97);
endShape(CLOSE);
// Nose and eye brow arch
stroke("red");
strokeWeight(1);
line(180, 83, 180, 120);
line(180, 120, 230, 120);
noFill();
arc(230, 150, 50, 60, 3*PI/2, PI/2 - 0.5);
// Flower earing in rotation
// Inspired by a code from Self-portrait in p5.js by Erica Noma, and modified into a rotating flower
translate(198, 230);
for (let i = 0; i < 10; i++) {
push();
fill(255, 0, 0); // Red petals
noStroke(); // Remove the stroke for the petals
rotate(radians(360 / 10) * i + angle2);
ellipse(0, 15, 10, 30);
pop();
angle2 += 0.003;
}
// Text in Rotation
}