xxxxxxxxxx
193
let cb;
let cn;
let ch;
let ce;
let cs;
let cp;
let cl;
let count = 0;
function setup() {
createCanvas(350, 400);
background(255);
translate(width/2,height/2);
colorMode(HSB,100);
frameRate(2);
angleMode(DEGREES);
cb = random(50,70);
cn = random(100);
ch = random(60,80);
ce = random(60,80);
cp = random(100);
cl = random(70,90);
cs = random(40,50);
}
function draw() {
if(random(10)>5)cb = random(50,70);
if(random(10)>5)cn = random(100);
if(random(10)>5)ch = random(60,80);
if(random(10)>5)ce = random(60,80);
if(random(10)>5)cp = random(100);
if(random(10)>5)cl = random(70,90);
if(random(10)>5)cs = random(40,50);
strokeWeight(1);
background(255);
translate(width/2,height/2-20);
stroke(100);
ellipse(0,0,250,300);
ellipse(-50,0,50,20);
ellipse(50,0,50,20);
noFill()
stroke(100);
fill(cs, 100,100);
ellipse(0,0,250,310);
beard();
nose();
eyes();
hair();
noFill()
}
function eyebrow(x,y){
}
function eyes(){
fill(255);
noStroke();
ellipse(-45,0,45,18);
ellipse(45,0,45,18);
noStroke();
fill(ce,100,100);
ellipse(-45,0,17);
ellipse(45,0,17);
fill(cp,100,30);
ellipse(-45,0,10);
ellipse(45,0,10);
let x = sin(random(360),)
ellipse();
noFill();
strokeWeight(5);
stroke(cb,100,100)
let r = random(47,54)
arc(35,0, 100,r, 240,340);
arc(-35,0, 100,r, 200,300);
}
function beard(){
noStroke();
fill(cb,100,100);
arc(0, 0, 250, 310, 0, 180, 360);
fill(cs,100,100);
beginShape();
curveVertex(100, 0);
curveVertex(100, 0);
curveVertex(60, 90);
curveVertex(-60, 90);
curveVertex(-100, 0);
curveVertex(-100, 0);
endShape();
let r = random(-2,2);
fill(cb,100,100);
ellipse(0,110,90,70);
fill(cs,100,100);
arc(0,105,70,40,170,10,OPEN);
ellipse(0,108,70,30);
fill(cb,100,100);
ellipse(0,125,25,25);
noFill();
stroke(cl,100,100);
strokeWeight(3);
arc(0+r/2,92,55,10,10,170);
arc(0+r/2,89,50,10,10,170);
strokeWeight(1);
stroke(cp,100,30);
arc(0+r,90,60,10,10,170);
strokeWeight(1);
/* strokeWeight(2);
for(let i=0;i<300;i++){
let t = random(0,180);
let x = (cos(t)*random(125));
let y = (70+sin(t)*random(95));
stroke(random(80,120),random(40,70),50);
line(x,y,x,y+random(10));
}*/
}
function nose(){
noStroke();
fill(cn,100,100);
beginShape();
curveVertex(5, 5)
curveVertex(5, 5)
//curveVertex(5, 31)
//curveVertex(5, 31)
let r = random(-1,1)
// curveVertex(7+r, 40)
curveVertex(10+r, 40)
curveVertex(15+r, 48)
curveVertex(20+r, 48);
curveVertex(20+r, 50);
endShape();
fill(cp,100,70);
ellipse(10+r,62,9,2);
ellipse(-7+r,63,9,2);
}
function hair(){
strokeWeight(3);
stroke(ch,100,100);
noFill()
for(let i = 0; i<100; i++){
let x1 = random(-5,5);
let y1 = random(-120,-170);
let x2 = random(150,200);
let y2 = random(-90,-160);
let x3 = random(70,120);
let y3 = random(70,150);
let x4 = random(80,170);
let y4 = random(80,150);
bezier(x1,y1,x2,y2, x3,y3,x4,y4);
}
for(let i = 0; i<100; i++){
let x1 = random(-5,5);
let y1 = random(-120,-170);
let x2 = random(150,200);
let y2 = random(-90,-160);
let x3 = random(70,120);
let y3 = random(70,150);
let x4 = random(80,170);
let y4 = random(80,150);
bezier(-x1,y1,-x2,y2, -x3,y3,-x4,y4);
}
}