Diferencia entre revisiones de «Isidora Correa proyecto 7 IE 2012»

De Casiopea
Sin resumen de edición
Sin resumen de edición
 
(No se muestra una edición intermedia del mismo usuario)
Línea 1: Línea 1:
{{Proyecto
{{Proyecto
|Título=Isidora Correa proyecto 7 Insectario IE 2012
|Título=Isidora Correa proyecto 7 IE 2012
|Tipo de Proyecto=Proyecto de Curso
|Tipo de Proyecto=Proyecto de Curso
|Palabras Clave=tarea 7
|Palabras Clave=tarea 7
Línea 8: Línea 8:
|Cursos Relacionados=Imagen Escrita 2012
|Cursos Relacionados=Imagen Escrita 2012
|Profesor=Herbert Spencer
|Profesor=Herbert Spencer
|Alumnos=Isidora Correa
}}
}}
Insectario;
Insectario;

Revisión actual - 18:58 25 jul 2012


TítuloIsidora Correa proyecto 7 IE 2012
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 7
Período2012-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)Isidora Correa
ProfesorHerbert Spencer

Insectario;

Insectos[] ins; float margin = 60;

void setup() {

size(700, 700); int ynum = 9; int xnum = 9; ins = new Insectos[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 Insectos(x, y);
   c++;
 }

} smooth(); }


void draw() {

background(#BDCE43); for (int i = 0; i < ins.length; i++) {

 ins[i].render();

} }


class Insectos {

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

 this.y = y;
 this.x = x;
 vn = round(random(10, 30));
 v = new float[vn][6];
 tam = 130;
 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/6, h/3);
 }

} void trace() {

 noFill();
 stroke(0);
 strokeWeight(3);
 beginShape();
 vertex(v[1][0], v[1][0]);
 for (int i = vn; i < 0; i++) {
   curveVertex(v[1][0], v[i][1]);
 }
 vertex(v[vn-3][0], v[vn-3][3]);
 endShape();

} void render() {

 pushMatrix();
 {
   translate(x, y);
   trace();
   scale(-1, 1);
   trace();
 }
 popMatrix();

} }

void keyPressed() {

if (key == 'a') {

 for (int i = 0; i < ins.length; i++) {
   ins[i].init();
 }

} if (key == 'b') {

 for (int i = 0; i < ins.length; i++) {
   ins[i].tam--;
   ins[i].init();
 }

} if (key == 'c') {

 for (int i = 0; 1 < ins.length; i++) {
   ins[i].tam++;
   ins[i].init();
 }

} }