Código:
/**
* Pulses.
*
* Software drawing instruments can follow a rhythm or abide by rules independent
* of drawn gestures. This is a form of collaborative drawing in which the draftsperson
* controls some aspects of the image and the software controls others.
*/
int angle = 0;
void setup() {
size(1000, 1000); //tamaño pantalla
background(100,random(20,70),100); //color fondo (comando random cambia el color cada vez que lo abro)
noStroke();
fill(0, 102);
}
void draw() {
// Draw only when mouse is pressed
if (mousePressed == true) {
angle += 5; //modifica el centro del ciurculo dibujado
float val = cos(radians(angle)) * 17.0; //tamaño *00.0 de circulos
for (int a = 0; a < 360; a += 1) { //forma de la flor
float xoff = cos(radians(a)) * val;
float yoff = sin(radians(a)) * val;
fill(random(0,255),random(10,80),random(30,50)); //instruccion controla color dibujo
ellipse(mouseX + xoff, mouseY + yoff, val, val); //dibuja con el mouse
}
fill(random(20,30),random(0,255),random(100,200)); //color segunda figura
rect(mouseY, mouseY, 3, 5); //tamaño segunda figura y direccion
}
}
Ejemplos:
No hay comentarios:
Publicar un comentario