Bárbara Quiroz: Pincel

De Casiopea


TítuloBárbara Quiroz: Pincel
Tipo de ProyectoProyecto de Taller
Palabras Clavetarea 4
Período2013-2013
AsignaturaImagen Escrita 2013 - DIS,
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)Bárbara Quiroz
ProfesorHerbert Spencer


float tam;

void setup() {
  size(500, 500);
  background(0);
  stroke(30, 80);
}

void draw() {

  tam = dist(mouseX, mouseY, pmouseX, pmouseY); 
  if (mousePressed) {
    int cantidad = round(map(tam, 0, 200, 0, 10));
    triangulacion(mouseX, mouseY, cantidad, tam);
  }
}

void triangulacion(float x, float y, int mag, float tam) {
  pushMatrix();
  translate(x, y);
  for (int i = 0; i < mag; i ++) {
    fill(140, 23, 23);
    triangle(random(-tam), random(tam), random(-tam), random(tam), random(-tam), random(tam));
  }
 translate(x, y);
  for (int i = 1; i < mag; i ++) {
    fill(255, 20);
    triangle(random(-tam), random(tam), random(-tam), random(tam), random(-tam), random(tam));
  }
  popMatrix();
}
void keyPressed() {
  if (key == ' ') {  //Cambiar el fondo a gris
    background(125);
  }

  if (key == 'g' || key == 'G') {  //Al apretar G se guarda la imagen.
    saveFrame ("Pincel triangular");
  }
  if (key == 'a' || key == 'A') {  //Delinear la forma.
    stroke(125);
  }
  
  if (key == 'd' || key == 'D') {  //Volver a la pizarra vacia
    background(0);
  }
  
  
}

void keyReleased() {
  if (key == 'a' || key == 'A') {  // Soltando A se vuelve al color sin delinear
    stroke(30, 80);
  }
}