Interactive Authoring – Digital Landscape

First Creation:Screen Shot 2016-09-26 at 6.16.28 PM.png

Second:Moving Forward.png

Doodles:Color Vomit Spiral.pngColor Butterfly.pngScreen Shot 2016-09-28 at 3.32.19 PM.png

Code:

int lx = 838;
int ly = 500;
float ran = random(255);
float r = 255;
float g = 255;
float b = 255;
float sa = 255;
float bg = 0;

void setup() {
size (1676, 1000);

background(bg);
fill(0);
}

void draw() {
if (key==’q’) {
background(bg);
}
//———————————-adjusters——————————————-
//———display————————–
fill(255/2);
stroke(255/2);
rect(1526, 0, 150, 1000);//base
//—————color view————–
fill(r, 0, 0);
stroke(r, 0, 0);
rect(1555, 115, 33, 30);//———–r
fill(0, g, 0);
stroke(0, g, 0);
rect(1589, 115, 34, 30);//———–g
fill(0, 0, b);
stroke(0, 0, b);
rect(1622, 115, 33, 30);//———–b
fill(r, g, b);
stroke(255/3);
rect(1555, 15, 100, 100);//color view
//————-adjuster display————
fill(r, 0, 0);
stroke(r, 0, 0);
rect(1555, 185, 100, 100);//———–r
fill(0, g, 0);
stroke(0, g, 0);
rect(1555, 330, 100, 100);//———–g
fill(0, 0, b);
stroke(0, 0, b);
rect(1555, 475, 100, 100);//———–b

//———————————-logic———————————————
//————–r————–
if (mouseX > 1555 && mouseX <1655 && mouseY > 185 && mouseY < 235) {
r = r + 1;
} else if (mouseX > 1555 && mouseX <1655 && mouseY > 235 && mouseY < 285) {
r = r – 1;
}
if (r > 255) {
r = 255;
} else if (r < 0) {
r = 0;
}
//————–g————–
if (mouseX > 1555 && mouseX <1655 && mouseY > 330 && mouseY < 380) {
g = g + 1;
} else if (mouseX > 1555 && mouseX <1655 && mouseY > 380 && mouseY < 430) {
g = g – 1;
}
if (g > 255) {
g = 255;
} else if (g < 0) {
g = 0;
}
//————–b————–
if (mouseX > 1555 && mouseX <1655 && mouseY > 475 && mouseY < 525) {
b = b + 1;
} else if (mouseX > 1555 && mouseX <1655 && mouseY > 525 && mouseY < 575) {
b = b – 1;
}
if (b > 255) {
b = 255;
} else if (b < 0) {
b = 0;
}

//—————————–Strokes————————————————-
if (key==’1′) {
stroke(0);
}
if (key==’2′) {
stroke(255);
}
if (key==’3′) {
stroke(ran, ran, ran);
}
if (key==’4′) {
stroke(random(255), random(255), random(255), sa);
}
if (key==’`’) {
stroke(r, g, b, sa);
}

//———————————–draws——————————————–
if (mouseButton == LEFT) line(lx, ly, mouseX, mouseY);
if (mouseButton == RIGHT) {
lx=mouseX;
ly=mouseY;
}
}

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