Macarena Monroy: Pincel
De Casiopea
Título | Pincel-Timbre |
---|---|
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) | Macarena Monroy |
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(150, 200), random(150, 200), random(150, 200),50); noStroke(); ellipse(mouseX, mouseY, 30, 30); //defino la construcción de la figura del pincel. ellipse(mouseX+10, mouseY+10, 30, 30); } } 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)); } }