emoticon face generator
For whatever reason I had a lot of trouble getting this to do things that actually looked interesting and good when I started randomizing them so I ended up settling for something really simple, even though I’m not very happy about it.
I ended up spending so long trying to get the face to actually look skin-colored most of the time (which, as you can see, tanked miserably), and ran out of time to properly address the other things I wanted to add, like hair. And noses. And other necessary facial features, y’know. But at least it makes half-hearted reaction images?
//electronic media studio: interactivity
//variable list
float faceradius = 200;
float faceR = 232;
float faceG = 150;
float faceB = 150;
float rEye = 50;
float gEye = 75;
float bEye = 225;
float eyeSize = 40;
float vertA1 =100;
float vertA2 =100;
float vertB1= 120;
float vertB2C2 =200;
float vertC1 = 180;
float vertD1 = 200;
float vertD2 = 100;
void setup(){
size(300,300);
}
void draw(){
background(146,237,224);
strokeWeight(1);
fill(faceR, faceG, faceB);
ellipse (width/2, height/2, faceradius, faceradius);
float eyeLX = width/2 - faceradius*0.3;
float eyeRX = width/2 + faceradius*0.3;
fill(rEye,gEye,bEye);
ellipse (eyeLX, height/2, eyeSize, eyeSize);
ellipse (eyeRX, height/2, eyeSize, eyeSize);
strokeWeight (5);
noFill();
curve(vertA1,vertA2, vertB1,vertB2C2, vertC1,vertB2C2, vertD1,vertD2);
}
void mousePressed(){
eyeSize = random (10, 30);
faceradius = random (100, 200);
rEye = random (150, 255);
gEye = random (150, 255);
bEye = random (150, 255);
faceR = random (165, 210);
faceG = random (120, 210);
faceB = random (90, 190);
vertA1 = random (100,200);
vertA2 = random (80, 250);
vertB1 = random (100, 140);
vertB2C2 = random (150,210);
vertC1 = random (160, 220);
vertD1 = random (200,300);
vertD2 = random (80,250);
if (faceradius<150){
vertB2C2 = random(150,175);
}
}