xxxxxxxxxx
170
function setup() {
createCanvas(600, 600);
}
function draw() {
background(150, 0, 100);
//Draw the hair in the back of the head first
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(-30, 350, 200, 300, 150, 500, -100, 480);
// Draw the control points in red.
stroke(255, 0, 0);
point(-30, 350);
point(-100, 480);
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(-30, 350, 220, 300, 180, 500, -100, 480);
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(-30, 350, 240, 300, 210, 500, -100, 480);
//Draw the back hair on the right side
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(630, 350, 400, 300, 450, 500, 700, 480);
// Draw the control points in red.
stroke(255, 0, 0);
point(-30, 350);
point(-100, 480);
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(630, 350, 380, 300, 420, 500, 700, 480);
noFill();
strokeWeight(20);
stroke(300,200,0);
curve(630, 350, 360, 300, 390, 500, 700, 480);
//Draw the face and neck first
noStroke();
fill(200, 100, 50);
rect(260, 300,80,300)
noStroke();
fill(300, 150, 100);
ellipse(300, 250, 220, 300);
//Draw the close on top of neck
noStroke();
fill(0);
triangle(260, 450, 300, 600, 100, 600);
noStroke();
fill(0);
triangle(340, 450, 300, 600, 500, 600);
// Draw bezier curve for left side of the hair.
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 60, 100, 70, 170, 310, 40, 420);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 70, 100, 80, 200, 340, 50, 440);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 80, 100, 90, 230, 370, 60, 460);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 90, 100, 100, 260,400, 70, 480);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 100, 100, 110, 290,430, 80, 500);
// Draw bezier curve for right side of the hair.
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 60, 500, 70, 430, 310, 560, 420);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 70, 500, 80, 400, 340, 550, 440);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 80, 500, 90, 370, 370, 540, 460);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 90, 500, 100, 340, 400, 530, 480);
noFill();
stroke(30, 10, 10);
strokeWeight(20);
bezier(300, 100, 500, 110, 310,430, 520, 500);
//Draw the eyes
noStroke();
fill(0);
ellipse(250, 230, 50, 80);
// Style the arc.
noStroke();
fill(0, 200, 255);
// Update start and stop angles.
let biteSize1 = PI / 16;
let startAngle1 = biteSize1 * sin(frameCount * 0.1) + biteSize1;
let endAngle1 = TWO_PI - startAngle1;
// Draw the arc.
arc(250, 230,50, 80, startAngle1, endAngle1, PIE);
//Draw the second eye
noStroke();
fill(0);
ellipse(350, 230, 50, 80);
// Style the arc.
noStroke();
fill(0, 200, 255);
// Update start and stop angles.
let biteSize2 = PI / 16;
let startAngle2 = biteSize2 * sin(frameCount * 0.1) + biteSize2;
let endAngle2 = TWO_PI - startAngle2;
// Draw the arc.
arc(350, 230,50, 80, startAngle2, endAngle2, PIE);
// Draw the mouth
//Draw a black spline curve.
noFill();
strokeWeight(10);
stroke(0);
curve(250, 310, 300, 350, 340, 320, 290, 200);
//Draw the blush
fill(300,0,100)
noStroke()
ellipse(230,280,50,30);
ellipse(370,280,50,30);
//Draw my glasses
fill(200,150)
rect(190,200,100,80,10)
rect(310,200,100,80,10);
line(280,250,320,250)
//Draw the eye brow
// OPEN fill mode.
fill(30, 10, 10)
arc(250, 180, 50, 20,PI, 2*PI , OPEN);
arc(350, 180, 50, 20,PI, 2*PI , OPEN);
}