Using the mouse simple interactive art

Below You can see the code for something I created which is a simple interactive piece of art using Processing.

void setup() {
size(2000, 1500);
background(0);
frameRate(30);
smooth();
}
int c = 1;

void draw() {
float r = random(255);
float g = random(255);
float b = random(255);
if (mousePressed) {

if (mouseButton == LEFT) {
fill(r, g, b);
}

if (mouseButton == RIGHT) {
fill(25, 0, 255);
}

if (mouseButton == CENTER) {
fill(r, g, b);
}

ellipse(mouseX, mouseY, c, c);
}

c=((c+1)%80);
}

ifclick

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s