Felipe Rojas Montenegro: Imagen Escrita: Ciclo For

De Casiopea
Revisión del 23:42 25 abr 2013 de Coffeexpress (discusión | contribs.) (Página creada con «{{Proyecto |Título=Imagen Escrita: Ciclo For |Tipo de Proyecto=Proyecto de Taller |Palabras Clave=tarea 2, |Año de Inicio=2013 |Año de Término=2013 |Carreras Relacionad...»)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)


TítuloImagen Escrita: Ciclo For
Tipo de ProyectoProyecto de Taller
Palabras Clavetarea 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)Felipe Rojas Montenegro
ProfesorHerbert Spencer


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

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

void draw() {
  background(255);
  xElems = (int) mouseX / 2;
  yElems = (int) mouseY / 2;
  calc();
  for (float x = margen; x < height-margen; x += xSpace){
    for (float y = margen; y < width-margen; y += ySpace){
       line(x,y, 10,10);
    }
  }
}

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