Bárbara Quiroz: Ciclo For

De Casiopea
Revisión del 09:47 10 may 2013 de Bquiroz (discusión | contribs.)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)


TítuloBárbara Quiroz: Ciclo For
Tipo de ProyectoProyecto de Taller
Palabras ClaveImagen escrita, tarea 2
Período2013-2013
AsignaturaImagen Escrita 2013 - DIS,
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)Bárbara Quiroz
ProfesorHerbert Spencer


float margen, xSpace, ySpace;
int xElems, yElems;

void setup() {
  size(500,500);
  margen = 20;
  xElems = 30;
  yElems = 30;
  calc();
  mouseX = xElems;
  mouseY = yElems;
}

void draw() {
  background(255);
  xElems = (int) mouseX / 5;
  yElems = (int) mouseY / 5;
  calc();
  for (float x = margen; x < height-margen; x += xSpace){
    for (float y = margen; y < width-margen; y += ySpace){
      stroke(0, 250, 154);
      fill(0,100,0); 
      ellipse(x,y,20,50);
      
    }
  }
}

void calc() {
  xSpace = (width - 1) / (float)(xElems - 1);
  ySpace = (height - 1) / (float)(yElems - 1);
}