Diferencia entre revisiones de «Tarea8ValentinaOlivares»

De Casiopea
(Página creada con '{{Proyecto |Título=Valentina Olivares: tarea 8 |Tipo de Proyecto=Proyecto de Curso |Palabras Clave=tarea8 |Carreras Relacionadas=Arquitectura, Diseño Gráfico, Diseño Industr...')
 
Sin resumen de edición
Línea 4: Línea 4:
|Palabras Clave=tarea8
|Palabras Clave=tarea8
|Carreras Relacionadas=Arquitectura, Diseño Gráfico, Diseño Industrial
|Carreras Relacionadas=Arquitectura, Diseño Gráfico, Diseño Industrial
|Cursos Relacionados=Imagen Escrita 2012,  
|Cursos Relacionados=Imagen Escrita 2012,
|Profesor=Herbert Spencer,  
|Profesor=Herbert Spencer,
|Alumnos=Valentina Olivares,  
|Alumnos=Valentina Olivares,
}}
}}
import processing.pdf.*;
import processing.pdf.*;
Línea 23: Línea 23:
   
   
  */
  */


float margenIzquierda = 30;  
float margenIzquierda = 30;  
Línea 36: Línea 35:
   smooth();
   smooth();


 
float ancho = width - (margenIzquierda + margenDerecha);
 
  float ancho = width - (margenIzquierda + margenDerecha);
   escala = ancho/bosque123.width;
   escala = ancho/bosque123.width;
   noLoop();
   noLoop();

Revisión del 10:33 21 jun 2012



TítuloValentina Olivares: tarea 8
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea8
Del CursoImagen Escrita 2012,
CarrerasArquitectura, 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)Valentina Olivares
ProfesorHerbert Spencer

import processing.pdf.*;

PImage bosque123; // la foto: imagen del bosque PFont font; // la fuente tipográfica String[] code; // el texto del código

/*

Al exportar un PDF, Processing translada 
las unidades de pixeles a puntos tipográficos.

1 pt = 0.0352778 cm
1 cm = 28.346438837 pt

*/

float margenIzquierda = 30; float margenArriba = 20; float margenDerecha = 30; float margenAbajo = 20; float escala;

void setup() {

 bosque123 = loadImage("bosque123.jpg");   
 size(609, 765, PDF, "tarea8valentinaolivares.pdf");  // tamaño carta
 smooth();

float ancho = width - (margenIzquierda + margenDerecha);

 escala = ancho/bosque123.width;
 noLoop();
 background (255);
 smooth();


 font = createFont("Helvetica", 10, true); //  tipografía a partir de una fuente de sistema
 textFont(font, 10);
 code = loadStrings("trazo.pde"); // el pincel

}

void draw() {

 float spacer = 5;  


 for (int y = 0; y < bosque123.height; y += spacer) { 
   for (int x = 0; x < bosque123.width; x += spacer) {
     // el color
       float plotX = map(x, 5, bosque123.width, margenArriba, width-margenDerecha);
     float plotY = map(y, 0, bosque123.height, margenDerecha, margenArriba + (bosque123.height * escala));
     color c = bosque123.get(x, y);


     trazo(plotX, plotY, c, spacer);
   }
 }
 printCode(); 
 println("Listo. Presione Ctrl + K para ver el archivo pdf");
 exit();

} void printCode() {

 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/4, 2 * margenArriba + bosque123.height * escala + interlinea);
   interlinea += 15;
  }
}

/**************trazo*************/ void trazo(float x, float y, color c, float random) {

 fill(c);
 ellipse(x, y, map(brightness(c),25, 255,0,amp,5), 
 map(brightness(c),10, 255,amp,0));

}