Assignment 3 – Light

Concept:
I recently saw a post (below) about love that touched me very much, and I thought that I would be able to represent this idea visually using what I currently know about objects and arrays.

This was my initial idea, where the circles represent the waves of light radiating out from each of us and intersecting with other people’s lights:

And here is the final sketch, where each time you run the code, the circles start at random places, and the increments between the circles also vary. You can click the mouse to make the circles appear:

A bonus of the random starting locations of the circles is that each outcome made me think of different types of relationships. For example:

A mother and her child:

Long distance best friends:

Future lovers who are just about to meet for the first time:

I started out the assignment only meaning to depict the “long distance” visual, but the randomness sparked many more possibilities, which I was not expecting!

Highlight:
I am proud of this part of my code, because the forloop + objects + arrays integration was something that I struggled a bit to understand, but after watching several Coding Train videos and following his examples, I was able to apply the same principles to my own code.

let circles = [];

function setup() {
  createCanvas(500, 500);
  background(0);

  for (let i = 0; i < 2; i++) {
    let x = random(width);
    let y = random(height);
    let r = random(1, 50);
    circles[i] = new Circle(x, y, r);
  }
}

function draw() {
  if (mouseIsPressed){
      for (let i = 0; i < circles.length; i++) {
      circles[i].show();
      circles[i].increaseRadius();
      }
  }
}

Reflection and ideas for future work or improvements:
I would like to assign colors to the light waves, for example making the smaller circles brighter/more saturated and having the color fade out as the circles get bigger. It would also be cool to apply some kind of blur feature so that the circles look more like actual light.

Resources: 

 

 

Leave a Reply