Tarea 9 volcan

De Casiopea


TítuloTarea 9 volcan
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 9
Período2012-2012
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Montserrat Salvadó
ProfesorHerbert Spencer
 

import processing.pdf.*;

PImage volcan; 
PFont font; 
String[] code; 

float a = 10; 
float b = 10;
float d = 10;
float e = 10;
float escala;

void setup() {

  volcan = loadImage("volcan.jpg"); 
  size(609, 765, PDF, "volcan.pdf"); 


  float ancho = width + (b - e);
  escala = ancho/(float)volcan.width;

  noStroke();
  noLoop(); 
  background(255);

  font = createFont("Courier", 9);
  textFont(font, 9);

  code = loadStrings("pincel.pde");
}



void draw() {

  float spacer = 2.5;


  for (int y = 0; y <volcan.width; y += spacer) {
    for (int x = 0; x < volcan.height; x += spacer) {

      float plotX = map(x, 0, volcan.width, b, width -a);
      float plotY = map(y, 0, volcan.height, b, a + (volcan.height * escala));
      color c =volcan.get(x, y);
      trazo(plotX, plotY, c, spacer);
    }
  }
  printCode();
  println("PDF terminado");
  exit();
}

void printCode() {
float interlinea = 1;

interlinea += 1;
}

/***************************************      trazo       ****************************************/ 

void trazo(float x, float y, color c, float amp) {
fill(c);
int puntos = round(random(1));
for(int i = 0; i <= puntos; i++){
float a = hue(c) + random(10); 
float e = saturation(c) + random(2);
float b = brightness(c) + random(10);
float k = alpha (c) + random (1);
pushMatrix();
line(x,y,x+random(10),y+random(-2,10)); 
stroke(a,e,b,k);
popMatrix();
}

}