Génesis Morales: Tarea 8
De Casiopea
Título | Génesis Morales: Tarea 8 |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 8 |
Período | 2012- |
Asignatura | Taller Inicial 1ª y 2ª Etapa, |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Génesis Morales |
Profesor | Herbert Spencer |
import processing.pdf.*; PImage imagen; PFont font; String[] code; float mI = 30; // Margen Izquierda float mAr = 30; // Margen Arriba float mD = 40; // Margen Derecha float mAb = 30; // Margen Abajo float escala; void setup() { imagen = loadImage("1.jpg"); size(609, 765, PDF, "tarea_8.pdf"); // tamaño carta float ancho = width - (mI + mD); escala = ancho/imagen.width; noLoop(); background(255); smooth(); font = createFont("Courier", 15, true); textFont(font, 15); code = loadStrings("trazo.pde"); // cargo el código "trazo" (el pincel) } void draw() { float spacer = 10; for (int y = 0; y < imagen.height; y += spacer) { for (int x = 0; x < imagen.width; x += spacer) { // obtengo el color float plotX = map(x, 0, imagen.width, mI, width-mD); float plotY = map(y, 0, imagen.height, mAr, mAr + (imagen.height * escala)); color c = imagen.get(x, y); trazo(plotX, plotY, c, spacer); } } printCode(); texto(); println("Listo. Presione Ctrl + K para ver el archivo pdf"); exit(); } void printCode() { fill(#707171); // color de la letra float interlinea = 0; for (int i = 0; i < code.length; i++) { // escribo cada línea de código en la pantalla text(code[i], width/16, height/2 + 110 + interlinea); interlinea += 15; } } void texto() { fill(#000000); text("Génesis Morales", width - mD*5, height - mAb - 20); text("1 Año Arquitectura", width - mD*5, height - mAb); } /*TRAZO*/ void trazo(float x, float y, color c, float amp) { fill(c); int puntos = round(random(10)); for (int i = 0; i <= puntos; i++) { float a = hue(c) + random(10); float e = saturation(c) + random(50); float b = brightness(c) + random(200); pushMatrix(); ellipse(x, y, 10, 5); stroke(a, e, b); popMatrix(); } }