Felipe Rojas Montenegro: Imagen Escrita: Máquina para dibujar
De Casiopea
Título | Máquina para Dibujar |
---|---|
Tipo de Proyecto | Proyecto de Taller |
Palabras Clave | tarea 4 |
Período | 2013-2013 |
Asignatura | Imagen Escrita, |
Del Curso | Imagen Escrita 2013 - DIS, |
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) | Felipe Rojas Montenegro |
Profesor | Herbert Spencer |
float tam; void setup() { size(800, 600); background(255); stroke(10,50); } void draw() { tam = dist(mouseX, mouseY, pmouseX, pmouseY); if (mousePressed) { int cantidad = round(map(tam, 0, 5, 0, 5)); lineas(mouseX, mouseY, cantidad, tam); } } void lineas(float x, float y, int mag, float tam) { pushMatrix(); translate(x, y); for (int i = 1; i < mag; i ++) { line(random(-tam), random(-tam), random(tam), random(tam)); } rotate(y); for (int i = 1; i < mag; i ++) { line(random(-tam), random(tam), random(-tam), random(tam)); } popMatrix(); } void keyPressed() { String filename = "img/retrato-"+year()+"_"+month()+"_"+day()+"___"+hour()+"-"+minute()+"-"+second()+".png"; if (key == 's' || key == 'S') { //Para guardar la imagen. saveFrame(filename); println("se ha grabado exitosamente el archivo "+filename); } if (key == 'b' || key == 'B') { //Cambia a pincel blanco. stroke(255); println("Color Blanco Seleccionado"); } if (key == 'n' || key == 'N') { //Cambia a pincel negro. stroke(0); println("Color Negro Seleccionado"); } }