Major Project 1: Drawing Software

For this project, I was challenged to create a drawing program in Processing exploring the meaning of a digital landscape. Requirements included allowing for two different mouse-based interactions as well as at least four keystroke interactions.

To me, a digital landscape is like untapped land; a blank slate which you can mold to match your ideals or aesthetics. I wanted to create this feeling in my program by allowing the user to draw whatever they would like using a couple of different sized shapes along with the basic colors matching r.o.y.g.b.i.v (red, orange, yellow, green, blue, indigo and violet or in this case blue-violet).

Here is the coding I used to produce this software:

boolean Go;

void setup (){
background (255);
size (720,480);
}

void draw (){
//clear background
if ((keyPressed == true) && (key == ‘1’)) {
background (255);
}

/////

//make the ellipse size 40,40
if ((keyPressed == true) && ((key == ‘q’)) || (key == ‘Q’)) {
ellipse (mouseX,mouseY, 40,40);
}
//make the shape an ellipse size, 70,70
else if ((keyPressed == true) && ((key == ‘w’)) || (key == ‘W’)) {
ellipse (mouseX,mouseY, 70,70);
}
//make the shape a rectangle size 50,50
else if ((keyPressed == true) && ((key == ‘e’)) || (key == ‘E’)) {
rect (mouseX,mouseY, 50,50);
}

/////

//make the shape red
else if ((keyPressed == true) && ((key == ‘r’)) || (key == ‘R’)) {
fill (232,0,0);
}
//make the shape orange
else if ((keyPressed == true) && ((key == ‘o’)) || (key == ‘O’)) {
fill (255,132,0);
}
//make the shape yellow
else if ((keyPressed == true) && ((key == ‘y’)) || (key == ‘Y’)){
fill (255,246,0);
}

//make the shape green
if ((keyPressed == true) && ((key == ‘g’)) || (key == ‘G’)) {
fill (47,125,0);
}

//make the shape blue
else if ((keyPressed == true) && ((key == ‘b’)) || (key == ‘B’)) {
fill (0,204,255);
}

//make the shape indigo
else if ((keyPressed == true) && ((key == ‘i’)) || (key == ‘I’)){
fill (75,0,130);
}

//make the shape blue-violet
else if ((keyPressed == true) && ((key == ‘v’)) || (key == ‘V’)){
fill (138,43,226);
}

}
void mousePressed (){
if (Go = true){
fill (1);
rect (mouseX,mouseY, 30,25);
}
}

void keyPressed (){

}

Pressing any color key (indicated by the first letter of said color) once will switch which color is used to draw with. Holding the key describing a shape will allow it to draw across the screen, or you could press it once for the shape to appear by itself. Clicking the mouse will place a black rectangle of a specific size wherever the pointer is. Pressing 1 will refresh the image back to white.

Here is an example of an image created with this software.

Programmed Image

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