Paulina Martínez IE2012 Tarea 9
Título | Paulina Martínez IE2012 Tarea 9 |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 9 |
Período | 2012-2012 |
Del Curso | Imagen Escrita 2012, |
Carreras | 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) | Paulina Martínez |
Profesor | Herbert Spencer |
import processing.pdf.*;
PImage casas ; PFont font; // la tipografía String[] code; // el texto del código
float margenIzquierda = 30;
float margenArriba = 20;
float margenDerecha = 20;
float margenAbajo = 20;
float escala;
void setup() {
casas = loadImage("casas.jpg"); size(609, 765, PDF, "casas.pdf");
float ancho = width - (margenIzquierda + margenDerecha); escala = ancho/(float)casas.width;
noStroke(); noLoop(); background(255);
font = createFont("Arial", 8); textFont(font, 8);
code = loadStrings("trazo.pde"); }
void draw() {
float spacer = 15;
for (int y = 0; y < casas.height; y += spacer) {
for (int x = 0; x < casas.width; x += spacer) {
// obtengo el color float plotX = map(x, 0, casas.width, margenIzquierda, width-margenDerecha); float plotY = map(y, 0, casas.height, margenArriba, margenArriba + (casas.height * escala)); color c = casas.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 + casas.height * escala + interlinea); interlinea += 15; text("Paulina Martínez, Diseño",10,690); } }
void trazo(float x, float y, color c, float amp) { fill(c);
ellipse(x-10,y-2,10,15); triangle(x-10,y,x,y,x+20,y+10); }