Alumnus Exemplar: Máquina de Dibujo 2 - Achurados

De Casiopea
Revisión del 13:13 3 may 2013 de Hspencer (discusión | contribs.)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)


TítuloAchuralógrafo
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 4
Período2013-
AsignaturaImagen Escrita
Del CursoImagen Escrita 2013 - ARQ, Imagen Escrita 2013 - DIS
CarrerasArquitectura, Diseñ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)Alumnus Exemplar
ProfesorHerbert Spencer

float tam;

void setup() {
  size(500, 500);
  background(255);
  stroke(0, 50);
}

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 ++) {
    line(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);
  }
}