Tarea 8
Título | tarea 8 puente |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 8 |
Período | 2012- |
Asignatura | Imagen Escrita 2012, |
Del Curso | Taller Inicial 1ª y 2ª Etapa, |
Carreras | Arquitectura |
Alumno(s) | Paula Ramírez Guevara |
Profesor | Helbert Spencer |
import processing.pdf.*;
PImage puente;
PFont font;
String[] code;
float margenIzquierda = 30; float margenArriba = 20; float margenDerecha = 20; float margenAbajo = 20; float escala;
void setup() {
puente = loadImage("puente.jpg"); size(609, 765, PDF, "puente.pdf");
float ancho = width - (margenIzquierda + margenDerecha); escala = ancho/(float)puente.width;
noStroke(); noLoop(); background(255);
font = createFont("Courier", 8); textFont(font, 8);
code = loadStrings("Trazo.pde"); }
void draw() {
float spacer = 10;
for (int y = 0; y <puente.height; y += spacer) {
for (int x = 0; x < puente.width; x += spacer) {
float plotX = map(x, 0, puente.width, margenIzquierda, width-margenDerecha);
float plotY = map(y, 0, puente.height, margenArriba, margenArriba + (puente.height * escala));
color c = puente.get(x, y);
trazo(plotX, plotY, c, spacer); } } printCode(); println("----->PDF done!"); exit();
}
void printCode() { float interlinea = 0; for (int i = 0; i < code.length; i++) {
text(code[i], width/4, 2 * margenArriba + puente.height * escala + interlinea); interlinea += 15; } }
- TRAZO*******************
void trazo(float x, float y, color c, float amp) { fill(c);
ellipse(x, y, map(brightness(c), 89, 34, amp, 13),
map(brightness(c), 56, 76, amp, 8));
}