Kim López: Pincel

De Casiopea
Kim López: Pincel


TítuloKim López: Pincel
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 4
Período2013-
AsignaturaImagen Escrita,
Del CursoImagen Escrita 2013 - DIS,
CarrerasDiseñ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)Kim López
ProfesorHerbert 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(0,random(100));
    noStroke();
    ellipse(mouseX, mouseY, random(10,30), random(10,30)); //defino la construcción de la figura del pincel.
  }
}

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));
  }
}