Assignment-04 Face- IKA
I initially wanted to randomize the plant as well, but I became confused in terms of the curveVertex function. I also wanted the face to be a more irregular shape, possibly stroked with a hand-drawn feeling to it. The curveVertex function frustrates me. Despite how basic this is, I’m awful at code and even this took longer than needed.
float nose1Size= 280;
float nose2Size= 290;
float nose3Size= 300;
float eyesize= 15;
float eyeballs= 10;
float eyebrowWidth= 8;
float facewidth= 200;
float faceheight= 230;
void setup (){
size (600,600);
}
void draw (){
background (193, 211, 222);
// plant coming up from head
stroke (148, 173, 146);
line (300, 450, 300, 100);
fill (148, 173, 146);
beginShape();
curveVertex (300, 285);
curveVertex (330, 270);
curveVertex (310, 260);
curveVertex (300, 285);
endShape ();
beginShape();
curveVertex (300, 230);
curveVertex (270, 240);
curveVertex (240, 256);
curveVertex (300, 230);
endShape ();
beginShape ();
curveVertex (300, 200);
curveVertex (330, 190);
curveVertex (310, 182);
curveVertex (300, 200);
endShape ();
beginShape ();
curveVertex (300, 120);
curveVertex (320, 100);
curveVertex (310, 98);
curveVertex (300, 120);
endShape ();
beginShape ();
curveVertex (300, 120);
curveVertex (290, 95);
curveVertex (282, 90);
curveVertex (300, 120);
endShape ();
// done with plant
// face
fill (250, 245, 232);
noStroke ();
ellipse (300,400, facewidth, faceheight);
// eyes
noStroke ();
fill (180);
arc (260, 480, eyesize, eyesize, 0, PI+QUARTER_PI, OPEN);
arc (330, 480, eyesize, eyesize, 0, PI+QUARTER_PI, OPEN);
//eyeballs
fill (210);
ellipse (260, 480, eyeballs, eyeballs);
ellipse (330, 480, eyeballs, eyeballs);
//nose
fill(204, 186, 186);
triangle (nose1Size, 530, nose2Size, 510, nose3Size, 520);
//eyebrows
fill (210);
rect (245, 460, 30, eyebrowWidth);
rect (310, 460, 30, eyebrowWidth);
}
void mousePressed (){
facewidth = random (170, 290);
faceheight = random (200, 320);
nose1Size = random (230, 290);
nose2Size = random (260, 310);
nose3Size = random (270, 330);
eyebrowWidth = random (1, 10);
eyesize = random (10, 20);
eyeballs = random (5, 15);
}