Ilanit Hirnheimer: Imagen Escrita: Tarea 4- Pizarra
De Casiopea
| Título | Ilanit Hirnheimer: Imagen Escrita: Tarea 4- Pizarra |
|---|---|
| Tipo de Proyecto | Proyecto de Curso |
| Palabras Clave | tarea 4 |
| Del Curso | Imagen Escrita 2012, |
| 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) | Ilanit Hirnheimer |
| Profesor | Herbert Spencer |
//Pizarra que tiene la posibilidad de, apretanto teclas, cambiar de colores de lapiz, o cambiar el color de la pantalla borrando lo ya dibujado.
float d, grosor; // distancia y grosor
void setup() {
size(screen.width, screen.height); //pantalla completa smooth(); // suavizado (anti-alisaing) background(#99CCFF); // fondo negro stroke(255, 100); strokeCap(PROJECT);
}
void draw() {
if (mousePressed) {
// velocidad = distancia / tiempo
/* calcula distancia entre
la posición actual del mouse y la posición anterior */
d = dist(mouseX, mouseY, pmouseX, pmouseY);
grosor = map(d, 50, 100, 1, 10);
strokeWeight(d/6); // strokeWeight(grosor)
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
void keyPressed() {
if (key == 'a') { // borra
background(#CC6699);
}
if (key == 's') { // borra
background(#00ff00);
}
if (key == 'd') { // borra
stroke(#0000FF);
}
if (key == 'f') { // borra
stroke(#ffff00);
}
if (key == 'g') { // borra
stroke (#ff6633);
}
if (key == 'h') { // borra
background (0);
}
if (key == 'j') { // borra
stroke (#33FF00);
}
}