Sebastian cubillos tarea 8 canchas ciudad abierta
| Título | canchas ciudad abierta |
|---|---|
| Tipo de Proyecto | Proyecto de Curso |
| Palabras Clave | tarea n° 8 |
| Período | 2012- |
| Asignatura | Taller Inicial Común 1ª y 2ª Etapa, |
| Del Curso | Imagen Escrita 2012, |
| Carreras | Arquitectura, Diseñ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) | Sebastián Cubillos |
| Profesor | Herbert Spencer |
import processing.pdf.*;
PImage atardecer;
PFont font;
String[] code;
float margenIzquierda = 30;
float margenArriba = 20;
float margenDerecha = 20;
float margenAbajo = 20;
float escala;
void setup() {
atardecer = loadImage("atardecer.jpg");
size(609, 765, PDF, "canchasritoque.pdf");
float ancho = width - (margenIzquierda + margenDerecha);
escala = ancho/(float)atardecer.width;
noStroke();
noLoop();
background(255);
font = createFont("currier", 8);
textFont(font, 8);
code = loadStrings("trazo.pde");
}
void draw() {
float spacer = 30;
for (int y = 0; y < atardecer.height; y += spacer) {
for (int x = 0; x < atardecer.width; x += spacer) {
float plotX = map(x, 0, atardecer.width, margenIzquierda, width-margenDerecha);
float plotY = map(y, 0, atardecer.height, margenArriba, margenArriba + (atardecer.height * escala));
color c = atardecer.get(x, y);
trazo(plotX, plotY, c, spacer);
}
}
printCode();
println("----->PDF listo!");
exit();
}
void printCode() {
float interlinea = 0;
for (int i = 0; i < code.length; i++) {
text(code[i], width/4, 2 * margenArriba + atardecer.height * escala + interlinea);
interlinea += 15;
}
}
---------------trazo-----------------------------------------
void trazo(float x, float y, color c, float amp) {
fill(c);
stroke(c);
rect(x, y, map(brightness(c), 0, 255, amp, 0),
map(brightness(c), 0, 255, amp, 0));
}