Maria de los Angeles

De Casiopea
Pincel


TítuloPincel
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 4
Período2013-
AsignaturaImagen Escrita,
Del CursoImagen Escrita 2013 - ARQ,
CarrerasArquitectura
Alumno(s)Maria de los Angeles Muñoz
ProfesorHerbert Spencer

float tam;

void setup() {

size(500, 500);
background(255);
fill (#CCFF00);
strokeWeight(2);

} void draw() {

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

} void achurado(float x, float y, float mag) {

int num = round((float(mouseX)/float(width)) * 60);
pushMatrix();
translate(x, y);
 for (int i = 0; i < 60; i ++) {
 
  float var = random(-30,100);
 
  stroke(40 + var, 180 + var, 200 + var);
 
triangle(random(mag), random(-mag),random(mag), random(-mag),random(mag), random(-mag));

ellipse(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 == 'a' || key == 'A') { // Al apretar A se cambia el fondo de los cuadrados celeste
  fill(#3366FF); 
}

if (key == 'f' || key == 'F') { // Al apretar F se cambia el fondo de los cuadrados al color inicial

  fill(#CCFF00); 
}
if (key == ' ') { //Apretar espacio para borrar todo
    background(255);
 }

saveframe ("pincel.png")

}