Creative Coding Week 2: Exploring Emergence (1)
This exercise was investigating the effect of frame rate on a sketch. The effect of changing the frame rate can have a dramatic effect on the display. The first sketch below is the example provided in the course. Press the left and right arrow keys to change the frame rate (about 5 or 6 clicks to the right will reveal the more interesting variations.)
> View source code for preceding sketch.
/*
* Creative Coding
* Week 2, 05 - Moving Patterns 1
* by Indae Hwang and Jon McCormack
* Copyright (c) 2014 Monash University
*
* This sketch builds on the previous sketches, drawing shapes based on the
* current framerate. The movement of individual shapes combine to create a
* gestalt field of motion. Use the arrow keys on your keyboard to change the
* frame rate.
*
*/
// variable used to store the current frame rate value
int frame_rate_value;
void setup() {
size(500, 500);
frame_rate_value = 6;
frameRate(frame_rate_value);
rectMode(CENTER);
background(255);
}
void draw() {
background(255);
int num = 20;
int margin = 0;
float gutter = 0; //distance between each cell
float cellsize = ( width - (2 * margin) - gutter * (num - 1) ) / (num - 1);
int circleNumber = 0; // counter
for (int i=0; i 1) {
frame_rate_value--;
}
// set the frameRate and print current value on the screen
frameRate(frame_rate_value);
println("Current frame Rate is: " + frame_rate_value);
}
My sketch changed the shape of the objects and added some colour.
> View source code for preceding sketch.
/*
* Creative Coding
* Week 2, 05 - Moving Patterns 1
* by Indae Hwang and Jon McCormack
* Copyright (c) 2014 Monash University
*
* This sketch builds on the previous sketches, drawing shapes based on the
* current framerate. The movement of individual shapes combine to create a
* gestalt field of motion. Use the arrow keys on your keyboard to change the
* frame rate.
*
*/
// variable used to store the current frame rate value
int frame_rate_value;
color[] shade = new color[13];
void setup() {
size(500, 500);
frame_rate_value = 6;
frameRate(frame_rate_value);
rectMode(CENTER);
background(255);
}
void draw() {
background(255);
int num = 20; // orignally 20
int margin = 0;
float gutter = 0; //distance between each cell
float cellsize = ( width - (2 * margin) - gutter * (num - 1) ) / (num - 1);
shade[0] = 0xFF002200;
shade[1] = 0xFF004400;
shade[2] = 0xFF006600;
shade[3] = 0xFF008800;
shade[4] = 0xFF00AA00;
shade[5] = 0xFF00CC00;
shade[6] = 0xFF00FF00;
shade[7] = 0xFF22FF22;
shade[8] = 0xFF44FF44;
shade[9] = 0xFF66FF66;
shade[10] = 0xFF88FF88;
shade[11] = 0xFFAAFFAA;
shade[12] = 0xFFCCFFCC;
int circleNumber = 0; // counter
for (int i=0; i 1) {
frame_rate_value--;
}
// set the frameRate and print current value on the screen
frameRate(frame_rate_value);
println("Current frame Rate is: " + frame_rate_value);
}