Computer Coding Exercises

Screen Shot 2558-09-23 at 10.45.21 PM

The work is the repetition of a same random size rectangle with a random color and a shadow with in the frame. The square will change size and color in the different frame. The shadow display in different size of the square make the works stands out and also give the work 3-dimension look. The hardest part of the work is to place the shadow in the right spot to match up with the color rectangle. The work was inspirations from the Skittle fruits, which have a random color in the bag, the processing website and the tutorial workshop week 5 – 8. In week 5(http://medadada.net/), I get to use the Processing to create a loop of the ellipse. After that I decided to change the ellipse to the rectangle. The processing.org is useful as it is give an example of key code, which I use it in the artwork. The website also give a clearer understanding of how to use the processing. With the use of the website such as; medadada.net, processing.org and tutorial I learned how to use the processing to sketch, color and with the improvement I know how to make the code easier to read which result are show in the final work.

code:

void setup() {
size(800, 800);
noStroke();
frameRate(1);
}

void draw() {
background(185);
int number = (int) random(10, 40);
int between = (int) random(2, 10);
float rectsize = ( width – (number++) * between ) / (float)number;
float X = rectsize/20.0;
float Y = rectsize/20.0;
for (int a=0; a<number; a++) {
for (int b=0; b<number; b++) {
fill(random(160), 180);
rect(between * (a+1) + rectsize * a + X, between * (b+1) + rectsize * b + Y, rectsize, rectsize);
fill(random(255), random(255), random(255),random(255) );
if (mousePressed) {
fill(random(247), random(100), random(100), 180);
}
rect(between * (a+1) + rectsize * a, between * (b+1) + rectsize * b, rectsize, rectsize);
}
}
}

Click on the image for a larger view

 

 

Screen Shot 2558-09-23 at 10.45.54 PM

inspirations works from the medadada.net:

Screen Shot 2558-09-24 at 1.09.30 AM

Screen Shot 2558-09-23 at 10.46.57 PM

Screen Shot 2558-09-23 at 10.52.48 PM

Screen Shot 2558-09-23 at 10.52.58 PM

 

 

 

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