Author Archive

Face Generator

Generative Faces

float e1 = 195;
float e2 = 195;
float e3 = 195;
float bgc = 150;

float c1= 50;
float c2= 60;
float c3= 260;
float c4= 170;
void setup() {
  size(480,500);
  
 
}

void draw() {
 background(bgc);
  //hair
  fill(0);
  rect(170, 120, 160, 160, 10);
  //head
  fill(166,117,40);
  ellipse(250, 240, 200, 200);
  //white 
  fill(255);
  ellipse(210, 210, 20, 20);
  ellipse(290, 210, 20, 20);
  //black
  fill(0);
  ellipse(290, 210, 10, 10);
  ellipse(210, 210, 10, 10);
 //mouth
 
 curve(c1, c2, 200, 265, 300, 265, c3, c4); //60  *
 //eyebrows
 line(200,e1,220,e2);
 line(279, e3,300,195); 
 strokeWeight(2);
 
 
if(mousePressed){
  e1=random(170,200);
  e2= e1;
  e3= random (190,205);
 
  c1= random(0,200);
  c2= random(0,200);
  bgc = bgc+1; 
  
  
}


  }

Homework #1 Portrait

Screen Shot 2015-02-10 at 8.18.59 AM

void setup() {
  size(480,500);
  background(120);
 
}

void draw() {
 rect(170, 120, 160, 160, 7);
  fill(166,117,40);
  ellipse(250, 240, 200, 200);
  fill(255);
  ellipse(210, 210, 20, 20);
  ellipse(290, 210, 20, 20);
  fill(0);
  ellipse(290, 210, 10, 10);
  ellipse(210, 210, 10, 10);
 arc(250, 260, 80, 80, 0, HALF_PI+HALF_PI, PIE);

  }