Interactive Authoring: Digital Landscape Redux

abstract-whatever-fuckkits

//rectangle
float rectH = 100;
float rectW = 100;
//ellipse
float elliH = 100;
float elliW = 100;
//color
float red = 255;
float green = 255;
float blue = 255;
float alpha = 100;
//triangle
float TriX1= 100;
float TriY1= 100;
float TriX2= 100;
float TriY2= 100;
float TriX3= 100;
float TriY3= 100;

void setup() {
size (720, 480);
frameRate (60);
background (4,0,255);
}

void draw() {
noStroke();
fill (red, green, blue,alpha/10);
if (keyPressed) {
if (key == ‘4’) {
rect (mouseX, mouseY, rectH, rectW);
}
} else if (key == ‘5’) {
triangle (TriX1, TriY1, TriX2, TriY2, TriX3, TriY3);
} else if (key == ‘6’) {
ellipse (mouseX, mouseY, elliH, elliW);
}
}

void keyPressed() {
if (key == ‘1’) {
rectH = random(100);
rectW = random(100);
red = random(255);
green = random(255);
blue = random(255);
alpha = random(100);
}
if (key == ‘2’) {
red = random(255);
green = random(255);
blue = random(255);
alpha = random(100);
TriX1= random(100);
TriY1= random(100);
TriX2= random(100);
TriY2= random(100);
TriX3= random(100);
TriY3= random(100);
}
if (key == ‘3’) {
elliH = random(100);
elliW = random(100);
red = random(255);
green = random(255);
blue = random(255);
alpha = random(100);
}
}

Advertisements
This entry was posted in Non-TimeBased and tagged , , , . Bookmark the permalink.

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