Javier Garin: Polígono

De Casiopea
Revisión del 14:19 24 may 2013 de Javiergarin (discusión | contribs.)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)
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)Javier Garin
ProfesorHerbert Spencer
int num = 10;

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

void setup() {

 size(500, 500);
}

 void draw() {

 background (#39A7A1);
 num = mouseX / 40;  
 float i = TWO_PI / num; 

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

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

 beginShape ();
  fill (#FCFCFC);
  for (float t = 0; t < TWO_PI; t = t + i) {

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

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

 beginShape ();
  fill (#FCFCFC);
  for (float t = 0; t < TWO_PI; t = t + i) {

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

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

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

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

    x = cos(t) * r + width/9;
    y = sin(t) * r + height/9;
    vertex (x, y);
  }
  endShape ();
  
  String filename = "poligono polar javier garin-"+year()+"_"+month()+"_"+day()+"___"+hour()+"-"+minute()+"-"+second()+".png";
  if (key == 's' || key == 'S') {
    saveFrame(filename);
    println("se ha grabado exitosamente el archivo "+filename);
  }
  if (key == ' ') {
     }

}