Bruno Marambio: Tramas 3

De Casiopea
Líneas1



TítuloLíneas1
Tipo de ProyectoProyecto de Curso
Del CursoImagen Escrita,
CarrerasArquitectura
Alumno(s)Bruno Marambio Márquez
ProfesorHerbert Spencer
float mx, my, nx, ny;
//float [][] coords;

void setup() {
  size(700, 480);
  
  mx=30; //margen horizontal
  my=30;//margen vertical
  nx=5;//numero de elementos en x
  ny=5;//numero de elementos en y
  
  //coords = new float [nx*ny][2];//tabla para ordenar y guardar coordenadas
  
  smooth();
  noLoop();
  
  noStroke();
  fill(0);
}

void draw (){
  background(255);
  float spx, spy, px, py;
  
  spx= (width - (2*mx)) /nx;
  spy = (height -( 2* my)) /ny;
  
  for (int y =0; y < ny; y++) {
    for(int x =0; x < nx; x++) {
      
      px = mx + (x * spx);
      py = my + (y * spy);
      
      float cr = random (1, 254);
      float co = random (1, 250);
      float cl= random (1,255);
      float c = random (5, 9);
      fill (co, cl, cr);
      triangle(10, 3, px, py, c, c);
       
  }
}
  }