Final outcome

After playing around with the code for a while, adjusting colours and speeds and the line between functions I settled on this as my final wall paper –

I went for a strong black and white contrast with the background and the inbetween lines as they make such beautiful geometric shapes when the interact with each other that I wanted this to be them main focus then with a nice bold hint of colour on the circles to brighten it up a bit.

It works great as a desktop background but also, in a futuristic sense, if projected on a wall I think it’d be well suited as a feature wall for a bar or restaurant as it’s really quite transfixing soothing.

Final code –

ballCollection = new ArrayList();
for (int i = 0; i<200; i++) {
 Vec3D origin = new Vec3D(random(width), random(200), 0);
 Ball myBall = new Ball(origin);
void draw() {
//Calls the function of the class. The '.' opens up the class.
for (int i = 0; i<ballCollection.size(); i++) {
 Ball mb = (Ball) ballCollection.get(i);;
class Ball {
//global variables. location, speed...
Vec3D loc = new Vec3D (0, 0, 0);
 Vec3D speed = new Vec3D(random(-4, 4), random(-4, 4), 0);
Vec3D grav = new Vec3D(0, 0.01, 0);
 //constructor. how to build the class, calling variables, happens just once.
 Ball(Vec3D _loc) {
loc = _loc;
 void run() {
 void lineBetween() {
for (int i = 0; i <ballCollection.size(); i++) {
Ball other = (Ball) ballCollection.get(i);
float distance = loc.distanceTo(other.loc);
if (distance > 0 && distance < 100) {
 line(loc.x, loc.y, other.loc.x, other.loc.y);
 void bounce() {
if (loc.x > width) {
 speed.x = speed.x * -1;
 if (loc.x < 0) {
 speed.x = speed.x * -1;
 if (loc.y > height) {
 speed.y = speed.y * -1;
 if (loc.y < 0) {
 speed.y = speed.y * -1;
 void move() {

}void display() {
ellipse(loc.x, loc.y, 20, 20);

In this project I put a lot of my focus into full understanding the code I was writing, a lot of the time I found myself re writing the code over and over again so I could know how and why it was written. I think this has resulted in my final wallpaper not being that ambitious in design but the coding elements behind it being very complex under the surface. Its has allowed me to learn and understand how build basic shapes, how to use
variable to animate these shapes and get my head around the
types of variables like integers and floats then apply things like ‘if’
conditional statement and for loops to these variables. I then delved a little deeper watching hours of tutorials online to look at building classes and class instances with init and furthermore adding arraylists into this so I could build a collection of my class instances easily. From here I looked into changing my code so it used a vector library called toxiclibs which I had imported, I haven’t fully got my head around this part just yet but I plan on continuing to try and learn it. Finally I played around with lots of different functions. I found the structure of these really easy to understand and using the references on the processing website I was able to play around with such things as bounce, gravity and creating a line between my elements.

I’ve actually found myself really interested in this type of coding language and want to continue to build my knowledge of the subject to I can make my results a lot more unique and interesting pieces of interactive design. A lot of my research looked into mapping projections and this is something I would love to look into more in the future.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s