Assignment 2

Concept

I was inspired by Case Reas’ talk and his showing of Jared Tarbell’s Invader Fractal. The concept that the contrast in a group of squares could trick the brain into perceiving different shapes was intriguing to me. I wondered if increasing the complexity of artwork such as Fractal invaders could trick our perception into making more complicated constructions out of random arrangements. What if I changed the colors used? Or the frame rate? I tried to answer these questions through the assignment.

Implementation
//Fucntion to draw a quadrat of fractals
function drawfractals_1(c1, c2){
  //Nested for loops used to create rectangles for each row 
  for (let j=0; j<4; j++){
    for (let i=0; i<4; i++){
      //array to select integers from
      let bin_array = [0,1];
      //selects randomly from 0 or 1
      let r_num= random(bin_array);
      //fills with black if random number returned is 0
      if (r_num == 0){
        fill(c1);
        rect(i+(50*i), j+(50*j), sq_width, sq_height);
      }
      //fills with white if random number returned is 1 
      else {
        fill(c2);
        rect(i+(50*i), j+(50*j), sq_width, sq_height);
      }
    }    
  }
}

This part of the code is the function that generates one section of the random squares. It creates a random pattern by choosing whether the color will be dark or light through an binary array passed through the random() function.

Embedded sketch

Here the fractals or images are created by splitting the sketch into 4 quadrants which generate on their own a random pattern. Every iteration also has a random chance of possessing a different complimentary color combination.

I also thought that making the sketch go blank when clicked on would help someone refocus and find shapes in the patterns formed.

Reflection and ideas for future work or improvements

After staring at the patterns generated for hours, I have realized that it is probably the greater simplicity in the original fractal invaders artwork, which mirrors the pattern generated on half of the sketch to the other half, that creates some sort of meaning in our minds. I am slightly disappointed by the bulkiness and inefficiency of the code as it has multiple functions carrying out the the same process, on the same type of object. Here I can overcome the issue by using a class for the square. This would have allowed me to manipulate the randomness and animation of the squares and overall artwork much easier.

One thought on “Assignment 2”

  1. Good to see your reflection about the duplication in your code – one way to start reusing your code more is to think about what parts of your code are the same and could be moved into a single function that uses its parameters to have a different effect. It looks like the functions are the same except for bin_array? If so you could probably have just one function and pass that in as a parameter.

    I didn’t find the click interaction very compelling – I think since the piece doesn’t feel like it’s building from one frame to the next the “clearing” doesn’t feel like it makes much difference. Maybe clicking to change the colour palette or resolution of the squares would be more interesting. Or maybe clicking changes how the squares are chosen (e.g. make white squares more likely instead of completely random).

Leave a Reply