Nicolás Molina: Polígono Polar

De Casiopea
Polígono Polar


TítuloPolígono Polar
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
AsignaturaImagen Escrita,
Del CursoImagen Escrita 2013 - ARQ,
CarrerasArquitectura
Alumno(s)Nicolás Molina
ProfesorHerbert Spencer

int num = 10;

float i = TWO_PI / num; float r = 70; float x, y;

void setup() {

 size(500, 500);
}

 void draw() {

 background (120);
 num = mouseX / 40;  
 float i = TWO_PI / num; 
 beginShape ();
 fill (#44D8D7);
 for (float t = 0; t < TWO_PI; t = t + i) {
   x = cos(t) * r + width/3.5;
   y = sin(t) * r + height/2;
   vertex (x, y);
  }
  endShape ();
  
   beginShape ();
  fill (#EA781A);
  for (float t = 0; t < TWO_PI; t = t + i) {

    x = cos(t) * r + width/1.4;
    y = sin(t) * r + height/5;
    vertex (x, y);
  }
  endShape ();
 
    beginShape ();
  fill (#06BF13);
  for (float t = 0; t < TWO_PI; t = t + i) {

    x = cos(t) * r + width/3;
    y = sin(t) * r + height/4.5;
    vertex (x, y);
  }
  endShape ();
  
     beginShape ();
  fill (#F2EC33);
  for (float t = 0; t < TWO_PI; t = t + i) {

    x = cos(t) * r + width/2;
    y = sin(t) * r + height/3;
    vertex (x, y);
  }
  endShape ();

  String filename = "poligono polar nicolas molina-"+year()+"_"+month()+"_"+day()+"___"+hour()+"-"+minute()+"-"+second()+".png";
  if (key == 's' || key == 'S') {
    saveFrame(filename);
    println("se ha grabado exitosamente el archivo "+filename);
  }
  if (key == ' ') {
     }

}