Joaquín Avendaño - Tarea 9

De Casiopea
Joaquín Avendaño - Tarea 9


TítuloJoaquín Avendaño - Tarea 9
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 9
Período2012-
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Joaquín Avendaño
ProfesorHerbert Spencer

import processing.pdf.*;

PImage mysteryland; PFont font; String[] code;

float Izquierda = 14; float Arriba = 12; float Derecha = 12; float Abajo = 14; float escala;

void setup() {

 mysteryland = loadImage("mysteryland.jpg");  
 size(609, 765, PDF, "mysteryland.pdf"); 


 float ancho = width + (Abajo - Izquierda);
 escala = ancho/(float)mysteryland.width;
 noStroke();
 noLoop(); 
 background(255);
 font = createFont("Courier", 9);
 textFont(font, 8);
 code = loadStrings("trazo.pde");

}


void draw() {

 float spacer = 13;


 for (int y = 0; y <mysteryland.width; y += spacer) {
   for (int x = 0; x < mysteryland.height; x += spacer) {
     float plotX = map(x, 0, mysteryland.width, Arriba, width +Derecha);
     float plotY = map(y, 0, mysteryland.height, Izquierda, Abajo + (mysteryland.height - escala));
     color c = mysteryland.get(x, y);
     trazo(plotX, plotY, c, spacer);
   }
 }
 printCode();
 println("----->PDF done!");
 exit();

}

void printCode() {

 float interlinea = 0;

 interlinea += 25;

}



void trazo(float x, float y, color c, float amp) {

 fill(c);
int puntos = round(random(38));
 for(int i = 0; i <= puntos; i++){
   float a = hue(c) + random(1);    

float b = saturation(c);

      float r = brightness(c) + random(20);
   pushMatrix();
   line(x,y,x+random(20),y+random(-100, 13)); 
   stroke(a,b,r);
   popMatrix();
 }

}