Kim López: Polígono

De Casiopea
Kim López: Polígono


TítuloKim López: Polígono
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
Período2013-
AsignaturaImagen Escrita,
Del CursoImagen Escrita 2013 - DIS,
CarrerasDiseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Kim López
ProfesorHerbert Spencer
int num = 19;
float i = TWO_PI / num; 
float r = 80;         
float x, y;            

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

void draw() {
  background(255);
  stroke(0);
  fill(0, 100, 0); 

  num = mouseX / 10;   
  float i = TWO_PI / num; 

  beginShape();
  for (float t = 0; t < TWO_PI; t = t + i) {
    x = cos(t) * r + width-100;
    y = sin(t) * r + height-80;
    vertex(x, y);
    x = cos(t) * r + width-80;
    y = sin(t) * r + height-100;
    vertex(x, y);
    x = cos(t) * r + 100;
    y = sin(t) * r + 80;
    vertex(x, y);
    x = cos(t) * r + 80;
    y = sin(t) * r + 100;
    vertex(x, y);
  }
  endShape();
  if (key == 's'){
    saveFrame("Figura-####.png");
  }
}