Francisca Torres: Pincel

| Título | Francisca Torres: Pincel |
|---|---|
| Tipo de Proyecto | Proyecto de Curso |
| Palabras Clave | tarea 4 |
| Período | 2013- |
| Asignatura | Imagen Escrita, |
| Del Curso | Imagen Escrita 2013 - ARQ, |
| Carreras | Arquitectura |
| Alumno(s) | Francisca Torres |
| Profesor | Herbert Spencer |
int num = 19;
float i = TWO_PI / num;
float r = 80;
float x, y;
int fondo = #FFFFFF;
int tam = 10;
void setup() {
size(500, 500);
background(fondo);
frameRate(75);
}
/* Construccion del pincel - timbre */
void draw() {
if (mousePressed == true) {
fill(random(255),random(255),random(255),30);
noStroke();
rect(mouseX,mouseY,50,50);
}
}
void keyPressed() {
if (key == ' ') { //Al apretar espacio aparece el fondo de nuevo.
background(fondo);
}
if (key == 'g' || key == 'G') { //Al apretar G se guarda la imagen.
saveFrame ("pincel####.png");
}
if (key == 'e' || key == 'E') { //Al mantener apretada la E se puede borrar.
fill(fondo);
}
if (key == '+') { //Al apretar + se aumenta el tamaño del pincel en 1
tam = tam + 1;
}
if (key == '-') { //Al apretar - se disminuye el tamaño del pincel en 1
tam = tam - 1;
}
if (key == 'r' || key == 'R') { //Al apretar R el trazo cambia de color a rojo
stroke(255, 0, 0, random(50, 100));
}
}
void keyReleased() {
if (key == 'e' || key == 'E') { // Al soltar E se vuelve al pincel normal.
stroke(0, random(100));
}
}