Donny Ahumada tarea 6
De Casiopea
Título | Donny Ahumada tarea 6 |
---|---|
Palabras Clave | tarea 6 |
Período | 2012- |
Asignatura | Taller Inicial 1ª y 2ª Etapa, |
Del Curso | Imagen Escrita 2012, |
Carreras | 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) | Donny Ahumada |
Profesor | Herbert Spencer |
// PIZARRA QUE GUARDA DIBUJO Punto gre1; // se crea clase float[][] guar = new float[2][10000]; // se crea arreglo que guardara posicion de puntos int a=1; void setup () {
background(255); size (600,600); gre1 = new Punto(color(#72FAC9),mouseX, mouseY); // se crea nueva clase con especificaciones
}
void draw () {
if (mousePressed == true) // condicion de dibujar al presionar el mouse { gre1.mostrar(); gre1.mover(); }
}
void keyPressed() {
if (keyPressed == true && key == 'e' || key == 'E') // condicion borrar dibujo { background (255); a=0; } if (keyPressed == true && key =='s' || key == 'S') // condicion de mostrar dibujo guardado { for (int h=0; h<10000;h++) { rect(guar[0][h],guar[1][h],5,5); } int h=0; } if (keyPressed == true && key =='w' || key == 'W') // condicion de borrar dibujo guardado { background(255); a=0; }
} class Punto {
color c; float posx; float posy; Punto (color ymc, float xplace, float yplace) // se crean factores de la clase { c = ymc; posx = xplace; posy = yplace; } void mostrar() { noStroke(); fill(c); rect(posx,posy,5,5); } void mover() // funcion de mover y guardr puntos en el dibujo { if (posx != mouseX) { guar[0][a] = mouseX; guar[1][a] = mouseY; a++; } posx = mouseX; posy = mouseY; }
}