Week 2 – Graphic Art

Concept: Order and Chaos

I get the inspiration from this week’s reading (watching) assignment, which is a talk by Casey. He talks about chaos and order in computer generated arts, and I think it is interesting to explore myself how computers can generate arts of order and chaos. My idea is to use simple lines to generate different shapes. I have experimented mostly with random() function, and discovered that even the randomly generated lines can actually follow certain patterns to form different shapes! In the meanwhile, the user can manipulate these lines to form different patterns and shapes so that they can personally feel the change from complete chaos to some order. Hope you enjoy!


Highlight of the code

The code is relatively short and simple. I mainly started with generating completely random lines with random sizes:

for (let i = 0; i < 50; i ++){
  let xPos1;
  let xPos2;
  let yPos1;
  let yPos2;
  let thickness = random(1, 5);
  strokeWeight(thickness);
  xPos1 = random(mouseX, 400);
  yPos1 = random(mouseY, 400);
  xPos2 = random(mouseX, 400);
  yPos2 = random(mouseY, 400);
  
  line(xPos1, yPos1, xPos2, yPos2);
}

Then for the user to manipulate the lines, I created a circle that follows the mouse so that the user can see clearly where the mouse is and better control the lines. Moreover, I modified the last line of the previous code to achieve user’s manipulation of the lines:

line(xPos1 - mouseX, yPos1 - mouseY, xPos2, yPos2);

I tried to use Perlin noise to make the lines move more naturally as we learnt in class. However, I feel the natural movement here undermines the sense of chaos, which is not intended here. Therefore, I decided not to use it and keep how these lines move as now.

Reflections and improvements

The execution is relatively easy, but it took me some time to finally come up with this idea. I tried several other ideas, but they all failed because my coding ability did not allow me to realize them. And this is why I ended up with this relatively simple code, but its effectiveness in exploring chaos and order is still strong.

And for future considerations, I am interested in knowing probably what other elements, such as other shapes, colors, movements, etc, could be added to the work to further explore the idea of chaos and order in computer generated arts. To me it is a very interesting concept even in other fields. Therefore, I’d like to explore more possibilities to discuss and apply this concept!

Sources:

Casey’s talk: https://vimeo.com/45851523

P5.js reference page: https://p5js.org/reference/

Leave a Reply