davideriboli
2/5/2016 - 4:33 PM

Smile #smile #processing #studenti #isia #variable

Smile #smile #processing #studenti #isia #variable

/*****************************
SKETCH PROCESSING
REALIZZATO DAGLI STUDENTI ISIA 
SPECIALISTICA EDITORIA 2015/16
GIUSEPPE ROMAGNO
LORENZO RINDORI
MARCO TOMASSOLI
*****************************/

float x1=100;
float x2=300;
float y1=0;
float y2=0;

void setup() {
  size(400,400);
}

void draw() {
  
  y1=mouseY;
  y2=300-(y1-200);
  
  if(mouseY<200) {
    y1=200;
  }
  if(mouseY>300) {
    y1=300;
  }
  if(mouseY<200) {
    y2=300;
  }
  if(mouseY>300) {
    y2=200;
  }

  
  //colora lo sfondo
  background(255,255,0);

  
  //disegna la bocca
  noFill();
  strokeWeight(10);
  bezier(x1,y1,x1,y2,x2,y2,x2,y1);
  
  //disegna il resto della figura
  fill(0);
  ellipse(100,100,50,50);
  ellipse(300,100,50,50);
}