Cesar Henriquez: poligono

De Casiopea


Poligonos 3.png


TítuloPoligono
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
Período2013-
AsignaturaImagen Escrita
Del CursoImagen Escrita 2013 - ARQ
CarrerasArquitectura
Alumno(s)César Henríquez
ProfesorHerbert Spencer

int num = 18;

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

void setup() {

size(500, 500);

}

void draw() {
background (#000066);
num = mouseX / 10;  
float i = TWO_PI / num; 
beginShape ();
fill (#00FF00);
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 (#FF0000);
 for (float t = 0; t < TWO_PI; t = t + i) {
   x = cos(t) * r + width/1.4;
   y = sin(t) * r + height/4;
   vertex (x, y);
 }
 endShape ();
 
 beginShape ();
fill (#00FF00);
for (float t = 0; t < TWO_PI; t = t + i) {
  x = cos(t) * r + width/1.4;
  y = sin(t) * r + height/1.4;
  vertex (x, y);
 }
 endShape ();
 
  beginShape ();
 fill (#FF0000);
 for (float t = 0; t < TWO_PI; t = t + i) {
   x = cos(t) * r + width/4;
   y = sin(t) * r + height/1.4;
   vertex (x, y);
 }
 endShape ();
saveFrame ("poligono.jpg")

}