Claudio Gómez:tarea7 imagen escrita 2012

De Casiopea
insectario con moscas volando


Títuloinsectario con moscas volando
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 7
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
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)Claudio Gómez
ProfesorHerbert Spencer

basado en el ejemplo del profesor Herbert Spencer, mas que nada, se trata de un insectario, en el cual varía la forma, los trazos aleatorios generan garabatos que parecen moscas, estas moscas están ordenadas, pero se genera un desorden de los trazos al mantener presionada la letra "a", este desorden se produce alternado, no todos los objetos (moscas), son alterados por esta letra, los objetos que son alterados comienzan a expandirse generando un vuelo desordenado de moscas, y al mantener presionada la letra "s" comienzan a alterarse el resto de los objetos generando moscas aleatorias.


Bics[] ins; float margin = 90;

void setup() {

 size(700, 700);
 
 int ynum = 9;
 int xnum = 8;
 ins = new Bics[ynum * xnum];
 float ysp = (height - (2 * margin)) / ((float)ynum - 1);
 float xsp = (width - (2 * margin)) / ((float)xnum - 1);
 int c = 0; // counter
 for (float y = margin; y <= height - margin; y+= ysp) {
   for (float x = margin; x <= width - margin; x += xsp) {
     ins[c] = new Bics(x, y);
     c++;
   }
 } 

}


void draw() {

 background(#2F6F1E);
 for (int i = 0; i < ins.length; i++) {
   ins[i].render();
 }

}


class Bics {

 float x, y;
 float[][] v; // vertices
 int vn;  // número aleatorio de vértices
 float tam;  // tamaño
 float w, h; // width, height


 Bics(float x, float y) {
   this.x =y;
   this.y= x;
   vn = round(random(3, 50));
   v = new float[vn][5];
   tam = 30;
   
   init();
 }
 void init() {
   w = tam/3;
   h = tam;
   for (int i = 0; i < vn; i++) {
     v[i][0] = random(w);
     v[i][1] = random(-h/2, h/2);
   }
 }
 void trace() {
   noFill();
   stroke(2);
   strokeWeight(.40);
   beginShape();
   vertex(v[1][0], v[1][1]);
   for (int i = 3; i < vn; i++) {
     curveVertex(v[i][0], v[i][1]);
   }
   vertex(v[vn-1][0], v[vn-1][1]);
   endShape();
 }
 void render() {
   pushMatrix();
   {
     translate(x, y);
     trace();
     scale(-2, 2);
     trace();
   }
   popMatrix();
 }

}

void keyPressed() {

 if (key == 's') {
   for (int i = 2; i < ins.length; i=i+1) {
     ins[i].init();
   }
 }
 if (key == 'a') {
   for (int i = 2; i < ins.length; i=i+3) {
     ins[i].tam++;
     ins[i].init();
     
     resetMatrix();
     saveFrame("32323244234234234.jpg");
   }
 
 }

}