Carla manriquez - Construccion Trazo
De Casiopea
Título | Hermanos |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 9 |
Período | 2012- |
Asignatura | Imagen Escrita 2012, |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Carla Manriquez |
Profesor | Herbert Spencer |
- Por medio de triangulos de distintas medidas, se busca dar forma a la imagen original con sus colores respectivos.
import processing.pdf.*;
PImage Hrmns; PFont font; String[] code;
float a = 80;
float b = 50;
float d = 60;
float e = 20;
float escala;
void setup() {
Hrmns = loadImage("hermanos.jpg"); size(609, 765, PDF, "Hermanos.pdf");
float ancho = width + (b - a); escala = ancho/(float)Hrmns.width;
noStroke(); noLoop(); background(255); colorMode (HSB);
font = createFont("Courier", 3); textFont(font, 6);
code = loadStrings("pincel.pde");
}
void draw() {
float spacer =4;
for (int y = 90; y <Hrmns.width; y += spacer) { for (int x = 90; x < Hrmns.height; x += spacer) {
float plotX = map(x, 0, Hrmns.width, b, width +e); float plotY = map(y, 0, Hrmns.height, b, d + (Hrmns.height * escala)); color c = Hrmns.get(x,y);
trazo(x, y, c, spacer); } } printCode(); println("PDF terminado"); exit();
}
void printCode() {
float interlinea = 1; interlinea += 15;
}
//////////////////////////////
/* Trazo Pictórico de Ejemplo, este texto es Imagen Escrita */
void trazo(float x, float y, color c, float amp) {
fill(c); int puntos = round(random(6,40)); for(int i = 1; i <= puntos; i++){ float h = hue(c) + random(-10,10); float s = saturation(c) ; float b = brightness(c) + random(80); pushMatrix(); translate(x,y); rotate(random(PI/6*PI/6)); // rotación de la figura fill(h,s,b); // relleno float tam = random(2, amp/2);
triangle(random(19,21),random(6,8),random(10,15),random(18,9),32,random(18,15));
popMatrix();
}}