Constanza Valdivia: Maquina de dibujo

De Casiopea


TítuloMaquina de dibujo
Tipo de ProyectoProyecto de Taller
Palabras ClaveTarea 4
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)Constanza Valdivia
<nowiki>

float tam;

void setup() {
  size(500, 500);
  background(255);
  stroke(119,192,203);
  fill(190,208,211);
}

void draw() {
  tam = dist(mouseX, mouseY, pmouseX, pmouseY);
  if (mousePressed) {
    achurado(mouseX, mouseY, tam);
  }
}

void achurado(float x, float y, float mag) {
  pushMatrix();
  translate(x, y);
  for (int i = 0; i < 10; i ++) {
  triangle(random(-mag), random(mag),random(-mag), random(mag),random(-mag), random(mag) );
  }
  popMatrix();
}

void keyPressed() {
  String filename = "img/retrato-"+year()+"_"+month()+"_"+day()+"___"+hour()+"-"+minute()+"-"+second()+".png";
  if (key == 's' || key == 'S') {
    saveFrame(filename);
    println("se ha grabado exitosamente el archivo "+filename);
  }
  if (key == ' ') {
    background(255);
  }
}

</nowiki>