Shreya’s Wilderness Forest – Final Project

THE FINAL SKETCH

Click on the button to enter the simulation!

Here is the full p5.js code: https://editor.p5js.org/shreyagoel81601/sketches/Y6gK7f1Iz

MY DESIGN GALLERY

Below are the various different outputs I got from my above sketch:

INSPIRATION, CONCEPT & ARTISTIC VISION

We studied fractals in class and I was specially fascinated by it. Just a recursive function with some property to it, a set of rules, and one can make such interesting patterns! I wanted to delve deeper and explore the field of fractals further for my final project, using it in a creative way to design intricate and mesmerising patterns that one wants to keep looking at.

Fractals are an important branch in mathematics and its recursive properties (i.e. self-similarity) are of interest in many fields. They are used in applied mathematics for modelling a variety of phenomena from physical objects to the behavior of the stock market. The concept of the fractal has also given rise to a new system of geometry crucial in physical chemistry, physiology, and fluid mechanics. But what if fractals were not limited to these set of equations and properties jargon to many but presented in a visually appealing way to the wider audience? To really show how broad and fascinating the field of math is and how it can be used to create art. That is what I set out my final project to be. To really curate a design or simulation which evolves over a period of time just based of fractal properties we study in math. More about fractals: source1, source2, source3.

Mathematical fractals:

Fractals in nature:

Out of all the fractals that exist out there, I was most intrigued by the ones that appear in leaves and trees and hence decided to re-create those using the idea of recursion with some of the known fractal equations and set of rules. However, the focus was not only on generating naturally occurring fractal patterns – the trees, but also putting them together in a creative way, artistically curating it into some sort of a generative algorithm or simulation, evolving over period of time with which the users could interact and play with. I proceeded with simulating a forest scenario – where users can plant a tree, make them fall, or have them sway upon their hover interaction, as if one is shaking their trunk!

THE PROCESS, TECHNICAL DESIGN & IMPLEMENTATION

I started with first reading thoroughly upon fractals and informing myself about those so I could choose which kind of fractals to go with, how to code them, what properties to use, etc. I had known what fractals are, but now, I was interested in knowing their origin, their nature, how it gives rise to certain forms and patterns, and so on. I went down a rabbit hole studying fractals, to the extent that I started proving its properties xD. It was very enriching!

My project uses 2 kinds of fractals – the L-system (for the instructions/home page), and stochastic branching fractals for the main wilderness forest part. I started with what we had in class first, the recursive way of building the stochastic trees and played with its design to create a forest like system. See below my initial sketch:

// in setup()
  fractalTree(width/4, height, length*1.2, 8);
  fractalTree(width/8, height, length*0.5, 3);
  fractalTree(width/2, height, length*1.5, 7);
  fractalTree(width/8*7, height, length*0.5, 3);
  fractalTree(width/4*3, height, length*0.7, 5);

// the recursive function
function fractalTree(x, y, len, weight) {
  push();
  if (len >= 2) {
    //draw the first line
    strokeWeight(weight);
    translate(x, y);
    line(0, 0, 0, -len);  
    translate(0, -len);
    weight *= sweight;
    strokeWeight(weight);
    weight *= sweight;
    
    let num = int(random(4));
    for(let i = 0; i <= num; i++) {
      push();
      let theta = random(-PI/2, PI/2);
      rotate(theta);
      fractalTree(0, 0, len*0.67, weight);
      pop();
    }
  }
  pop();
}

Above is a static version, it has no movement or user interaction yet. Next I tried exploring L-systems. Here is the sketch for that:

// in setup()   
  let ruleset = {
    F: "F[F]-F+F[--F]+F-F",
  };
  lsystem = new LSystem("F-F-F-F", ruleset);
  turtle = new Turtle(4, 0.3);

  for (let i = 0; i < 4; i++) {
    lsystem.generate();
  }

// in draw()
  translate(width / 2, height);
  
  let angle = map(mouseX, 0, width, -0.3, 0.3);
  let h = map(mouseY, height, 0, 0, 8);
  turtle = new Turtle(h, angle);
  
  turtle.render(lsystem.sentence);

After playing around and educating myself of the different ways one can use fractals to simulate trees and forest situations, it was time to curate the performance. I wanted to have the trees not be static, but grow slowly, and also sway as if wind is blowing. For this, it was necessary that I move away from the recursive way of coding because a recursive function just draws the tree once, done, it stores no property taht one can alter to later on play with it and achieve the results I intended to create. Hence, I transitioned to an OOP way inspired by Coding Train.

class Branch {

  constructor(begin, end, strokew) {
    this.begin = begin;
    this.end = end;
    this.finished = false;
    this.strokew = strokew;
    this.speed = random(4,12);
  }

  branchA() {
    let dir = p5.Vector.sub(this.end, this.begin);
    dir.rotate(random(-PI/2, PI/2));
    // dir.rotate(PI / 6 + dtheta);
    dir.mult(0.67);
    let newEnd = p5.Vector.add(this.end, dir);
    let b = new Branch(this.end, newEnd, this.strokew*0.8*0.8);
    return b;
  }

  branchB() {
    let dir = p5.Vector.sub(this.end, this.begin);
    dir.rotate(random(-PI/2, PI/2));
    dir.mult(0.67);
    let newEnd = p5.Vector.add(this.end, dir);
    let b = new Branch(this.end, newEnd, this.strokew*0.8*0.8);
    return b;
  }
}
let forest = [];
let numTrees = -1;

genButton = createButton("Grow");  
genButton.mousePressed(createNewTree);

function createNewTree() {
  let len = randomGaussian(height*0.25, 20);
  let x = random(10, width-10);
  let w = map(len, 0, height/2, 2, 12);
  
  let a = createVector(x, height);
  let b = createVector(x, height - len);
  let root = new Branch(a, b, w);

  let tree = []
  tree[0] = root;
  forest.push(tree);
  
  numTrees++;
  count = 0;

  generateBool = true;
}

function generate() {
  let tree = forest[numTrees];

  if (count < 12) {
    for (let i = tree.length - 1; i >= 0; i--) {
      if (!tree[i].finished) {
        tree.push(tree[i].branchA());
        tree.push(tree[i].branchB());
      }
      tree[i].finished = true;
    }
    count++;
  }
  else {
    generateBool = false;
  }
}

function draw() {
  if (generateBool) {
    generate();
  }
}

However, this was not easy or straightforward. I ran into many challenges.

BLOOPERS

To implement the sway feature, I decided to have the trees jitter upon mouse hover, to create the effect of a user shaking the tree. The basic idea for this was to change the angle of each branch for it to create a sway effect, but that lead to disintegrating the tree (see below).

This happens because when creating the tree, each branch starts from the end of previous branch, and when I rotate, the end point of previous branch moves but not the starting point of the new branch. The way I fixed this is by altering the end points for sway and not the angle and then redrawing the next branches based on this new end point.

if (mouseX < width && mouseX > 0 && mouseY < height && mouseY > 25) {
      for (let j = 0; j < forest.length; j++) {
        let tree = forest[j];
        if (abs(mouseX - tree[0].begin.x) < range){
          for (let i = 1; i < tree.length; i++) {
            tree[i].jitter();
          }
        }
      }
    }

Another issue I faced was nailing how many branches the tree should have. Because otherwise it was getting too heavy for the program to run and my laptop kept on crashing. If it was too little branches, then it would not look like a tree, or real, and would defeat the purpose of the whole model.

INSTRUCTIONS PAGE

THE PROCESS PHOTOS

IM SHOWCASE PRESENTATION

My project was exhibited at the Interactive Media End of Semester Showcase at New York University Abu Dhabi where it was interacted with by many people, not just students, but faculty, staff, dean from all majors.

Final Project Proposal

For my final project, I want to further develop my flocking system project. I was very happy with the output of that project and want to take it another step forward. Below are some pictures from that sketch:

It would be interesting to see what other designs can be created with a similar concept. Currently, I have 2-25 circles of random sizes placed on the canvas. The flocking simulation tries to either avoid or get attracted to these circles. What I am thinking right now is that I will have the users place the objects, and they may not only be circles, but other shapes too like star, square, triangle, hexagon and so on. I will integrate matter.js for this. I will also give my users a slider to change the size of the object and also the option to either attract towards or repel away from these objects. My current design thinking is the following:

I will also provide a menu in the beginning explaining how the users can interact with the project. This is not fully developed of course, but is just an initial idea:

Coding Assignment – Week #10

INSPIRATION & CONCEPT

Matter matter, it all around us. What comes to my mind when I think of matter? My childhood games! Ever made those lego towers or stacked building blocks only to knock them off? Or played that pyramid game at the children’s fair where you throw a ball at a stacked pyramid of paper cups? Those were a few of my favourite games and and this assignment is inspired by that. As I was going through matter.js, I was feeling playful and I have tried to capture that in this assignment.

IMPLEMENTATION

I employed the matter.js library to make building blocks – the colorful boxes. They randomly fall at the start on a static platform to kind of mirror the platform in the pyramid game. There is a pendulum that I provided to simulate the action of throwing a ball – only you swing this! The idea is for users to build their own building blocks and destroy them using the swinging ball in this playful simulation (see video below). All the blocks and and the ball is controlled by the user using the mouse.

I added a floor and a right wall so that the blocks do not all spill off screen. The left and above wall are deliberately not there so the the pendulum has room to swing.

Without the boundaries sketch version:


FINAL SKETCH

Link to full code: https://editor.p5js.org/shreyagoel81601/sketches/KnOeUyDwg

FURTHER DEVELOPMENT

Matter.js is an amazing library and has a lot of potential. For this project in particular, it would be nice to experiment with different density of medium instead of the default one and see how the blocks and the ball interact then. If lets say I set the density to be that of glycerine 1.3 g/cc, then I might be harder for the blocks to even sit on each other. I could also go ahead try out different shapes. I deliberately kept squares here because of the building block ideas, but I could try stars, triangles and stuff too.

Alien Intelligence by Prof. Neil – Reflection

“AI cannot think.”

“There is nothing creative about creativity.”

“Magic does not exist.”

These statements from Prof. Neil’s talk stuck with me today. They prompted a deep reflection on the intricate definitions of thinking, creativity, and design.

Geoffrey Hinton’s claim about an AI making a deductive assumption, suggesting a form of thinking, raised intriguing questions about the nature of cognition. As humans, we too often deduce thoughts based on assumptions. So how is our thinking different from that of an AI model? Aren’t humans also analysing everyday information and using deductive reasoning to think and take action? Professor Neil’s subsequent response that there are different forms of thinking emphasised the complexity of the matter. The dichotomy between AI’s deductive reasoning and Professor Neil’s claim that AI cannot truly “think” highlights the ambiguity in defining thinking itself.

The discourse extended to questions about creativity and design, challenging conventional beliefs. This reflection led me to ponder whether our apprehensions about AI stem from a lack of clarity in understanding these fundamental human attributes. What if AI can help us understand our own selves better? As Prof. Neil said, “Humans are not good at everything. We are really good at discriminating, not generating.” So, maybe AI can help with that? Instead of fearing its potential, maybe a paradigm shift is needed towards harnessing AI as a tool for amplifying human cognitive capacities. The lecture prompted a re-evaluation of our conceptual frameworks, urging me to embrace a more nuanced understanding of the dynamic relationship between AI and human cognition, hinting on a more symbiotic relationship for co-existence.

Coding Assignment Week #9 – Biology Much?

INSPIRATION & CONCEPT

I have been exploring a lot of physics and math, haven’t I? So I wanted to explore biology for this assignment, something way beyond my comfort zone… But thankfully I do not need to know biology for that, only coding!

So, I have often been fascinated with cells and tissues and those diagrams were few of my favourites to draw in school. I also researched a bit more into molecular biology and viewed some designs / images for more perspective. Then, I tried to model these through code using the flocking simulation as the base – yes!

The main idea or intention behind my work this week was to create patterns and designs using the flocking that do not intrinsically look like the behaviour of the flocking system. And I guess I was successful in that to some extent 🙂 I am very happy with my work.

Mood Board

THE PROCESS

As one can see in the above images, circular objects almost appear everywhere. Even in the neuron-like strands, one can htink of those strands either avoiding or circling around certain points. Hence, I started with adding a bunch of circles with random radii, which I called holes, to the canvas. The logic of the code is that the flocking system tries to avoid or circle around these circles to create desired results.

I started by writing a hole class as follows:

class Hole {
  
  constructor(x, y, r) {
    this.pos = createVector(x, y);
    this.r = r;
  }
  
  show() {
    push();
    noFill();
    circle(this.pos.x, this.pos.y, this.r*2);
    pop();
  }
}

and then creating the hole objects which are passed to the flocking system. Each boid tries to avoid this circle using a custom avoid() method I write inspired by our evade() and flee() methods.

let holes = [];

// make holes for neurons
for (let i = 0; i < 10; i++) {
    holes.push(new Hole(random(width), random(height), random(20,80)));
}

for (let i = 0; i < holes.length; i ++) {
    holes[i].show();
    flock.avoid(holes[i]);
}

The avoid method is as follows:

// in the flock.js class
avoid(hole) {
    for (let boid of this.boids) {
      // let obstacle = createVector(width/2, height/2);
      let d = p5.Vector.dist(boid.position, hole.pos);
      if (d > 0 && d < hole.r) {
        boid.avoid(hole); 
      }
    }
}

// in the boid.js class
avoid(hole) {
    let desired = p5.Vector.sub(this.position, hole.pos);
    desired.setMag(this.maxspeed);
    // Steering = Desired minus velocity
    let steer = p5.Vector.sub(desired, this.velocity);
    steer.mult(this.maxforce); // Limit to maximum steering force
    this.applyForce(steer);  
}

THE SKETCHES

As you can see above, the boids try to avoid the the circles and flee away from it.

Then I further played around with values and fine-tuned the parameters to achieve varying results.

A bit of a honey-comb effect:

To create certain knots at places, I also decided to add a few holes that would be attractors. I added more weight to this so it would attract more than the holes taht repel. This creates a very different kind of design – something that one would see though a microscope.

OUTPUT

All my lovely outputs of the code above can be seen in the below gallery!! Hope you all like them 🙂

FURTHER DEVELOPMENT

Try creating patterns with different kinds of shapes – thin rectangles, triangles and polygons to try and mimic other kinds of tissues and cells. One of the patterns that I really want to try and did not achieve in this attempt is the neurological one, neurons vein like here and there (the last 3 in my inspiration gallery). They would require some other kind of factors to attract and diffuse in a line kind if format and that is something I would like to try out in the future.

Coding Assignment Week #8

CONCEPT

For this week’s sketch, I wanted to explore the different autonomous behaviours we have covered in class and how they interact and respond to each other. In other words, what if instead of studying each steering method separately, we create a system where every object has its own steering behaviour and we how it affects and influences other vehicles having a different behaviour. With this idea, I started to experiment!

PROCESS

    1. Multiple wandering objects:
    2. Then I decided to have smaller objects to either pursue, evade, or arrive at one of these big wandering (blue) objects.
    3. Currently, in the above sketch, each smaller target is currently pursuing or evading a fixed predefined wanderer. I wanted to try to randomize that based on whichever wanderer is closest. I modified the code to calculate the minimum distance and store it and use that to assign the target. I made a line between the wanderer and pursuer / evader for increased visibility.
      Here is the code for it:

      let steering = [];
      
      // to calculate and find min distance between current seeker 0 and all wanders
      let d = p5.Vector.dist(vehicle_seekers[0].position, vehicle_wanderers[0].position); // to store the min distance - initially start with first available dist
      let index = 0; // to store which wanderer is closest
      for (j = 1; j < N1; j++) {
        let d2 = p5.Vector.dist(vehicle_seekers[0].position, vehicle_wanderers[j].position);
        if (d2 < d) {
          d = d2;
        }
      }
      
      steering[0] = vehicle_seekers[0].pursue(vehicle_wanderers[index]);
      
      // making a line between them for more visibility
      push();
      stroke(2,255,2);
      line(vehicle_seekers[0].position.x, vehicle_seekers[0].position.y, vehicle_wanderers[index].position.x, vehicle_wanderers[index].position.y);
      pop();
    4. Some improvisation. Firstly, I added more wanderers for the system to be more dynamic. Secondly, the pursuer gets suck to the target once it seeks it (i.e. reaches it). So, I tried the opposite. Instead of pursuing the closest target, pursue the farthest. So, it keeps changing its direction and does not get stuck.

      The code for it changed as described below:

      let steering = [];
      
      // to calculate and find max distance between current seeker 0 and all wanders
      let d = p5.Vector.dist(vehicle_seekers[0].position, vehicle_wanderers[0].position); // to store the max distance - initially start with first available dist
      let index = 0; // to store which wanderer is closest
      for (j = 1; j < N1; j++) {
        let d2 = p5.Vector.dist(vehicle_seekers[0].position, vehicle_wanderers[j].position);
        if (d2 > d) {
          d = d2;
        }
      }
      
      steering[0] = vehicle_seekers[0].pursue(vehicle_wanderers[index]);
      
      // making a line between them for more visibility
      push();
      stroke(2,255,2);
      line(vehicle_seekers[0].position.x, vehicle_seekers[0].position.y, vehicle_wanderers[index].position.x, vehicle_wanderers[index].position.y);
      pop();
    5. Lastly, I created my own trailing path with these new set of rules for steering behaviour to create the below output!

Pretty Mishap?

So, while on my way to figuring out the code for trailing paths, I kind of ran into this happy accident. The trails clearly do not appear as they should but it was interesting enough to document. I believe this is because I am not correctly popping from the list of paths and rotating indefinitely.

I then fixed the rotating problem but ran into something the professor warned us about – edge to edge lines!! (when the object wraps around, it draws a line across the page). I do like this effect too – seems like a women quilt / blanket.

It was easy to fix this as I did this modification for the pen plotter too in my midterm. Plotting dots was easy, but for plotting lines, I had to reset the line every time it made a huge jump so as to not have lines all across the page. This one was not exactly the same, but similar in terms of the concept.

FURTHER DEVELOPMENT

Currently my design is based on wanderers being the main targets. One way to improve this is by having different agents (objects) each having their own property of wandering, pursuing, evading etc., and calculating the minimum distance from each of those, not just the wanderers. This way, an evader could flee a pursuer closest to them, or a pursuer could seek a target farthest to them (not closest). That would be interesting to see.

SpiroSpectrum: Math’s Dance of Design – DN Midterm

THE FINAL SKETCH

Click on the sketch to generate a new pattern!

MY DESIGN GALLERY

Below are the various different outputs I got from my above sketch:

CONCEPT, INSPIRATION & ARTISTIC VISION

How fascinating would it be to be able to visualize complex math equations into an easy-to-look generative design pattern? Fascinating no!

Math is everywhere around us, in the simplest to most complex of the things, but we don’t always necessarily see it as math. For this midterm project, I wanted to explore mathematical equations and find a way to visualize them using generative art and give them a visible form. But which equation? Or multiple equations? How do I choose?

As a child, I most fondly played with the spirograph set (see pictures below). I would love to draw new designs and patterns through it. Different stencils and position of the pen give different designs.

Some spirographs in nature:

Did you know there are actual math equations that trace the path / locus of these designs? For this project, I wanted to explore the math behind this concept and make generative art within this constraint. Can one equation by itself give rise to multiple varied distinguished designs? What are the the parameters of the equation which give it a certain characteristic? How does changing these parameters affect the design and feel of it?

I did some background research on mathematical equations and spirographs. This website explains the generation of spirographs and the equation behind it in simple terms. I carefully followed and read this as I evolved my idea, tried to code the designs and understood the math behind the visuals I was getting.

THE PROCESS

I started by understanding the physics behind the Spirographs and how they work. So it is essentially a circle within a circle with a point somewhere not in the centre in which you place your pen to create the designs. So I tried to model this using the physics concepts of vectors, position, their rectangular components, oscillation, sine and cosine, we learnt in class.

This was my starting sketch:

Based on some initial calculations that I did:

Here is the code snippet for it which exemplifies this vector behaviour:

translate(width/2, height/2);
circle(0, 0, R); // draw outer bigger circle
center = createVector((R/2-r/2)*cos(angle), (R/2-r/2)*sin(angle)); // center of the inner circle based on my calculations
circle(center.x, center.y, r); // draw inner circle
circle(center.x + r/2*cos(-1*angle), center.y + r/2*sin(-1*angle), 5); // draw the point of drawing --> currently at the boundary of inner circle
angle += 0.1; // increment angle each frame

The above behaviour achieved by simple physics and vectors has the following equation (this I derived myself, but can also be found online):

Going further, I realised it might be easier to get the equation version of the vector’s x and y position to plot it. How will this help? This will help in changing the shapes from circle to say ellipse, hyperbola or from changing the position of the smaller circle to be inside or outside, which would generate interesting and non-generic patterns. This is the time to be creative now!

I experimented with the different parameters like the R, r, t (= angle), and even the functions of sine, cosine, tan, and function enclosed function, along with the changing the sign / direction of vector addition / subtraction to generate different designs.

The multiple iterations and designs I created:

1. Code:

calculate() { 
     this.x = (this.r+this.r)*(sin(this.angle))-this.d*0.41*tan((this.R-this.r)/this.r*this.angle*2); 
     this.y = (this.R-this.r)*tan(sin(this.angle*1.8))+this.d*0.57*tan((this.R+this.r)/this.r*this.angle); 
}

Outcome:

2. Code:

calculate() {
    this.x = (this.r+this.r)*(tan(this.angle))-this.d*0.41*tan((this.R-this.r)/this.r*this.angle*2);
    this.y = (this.R-this.r)*tan(sin(this.angle*1.8))+this.d*0.57*cos((this.R+this.r)/this.r*this.angle);
  }

Outcome:

3. Code:
calculate() {
    this.x = (this.R+this.r)*(cos(this.angle))-this.d*cos((this.R+this.r)/this.r*this.angle);
    this.y = (this.R+this.r)*(sin(this.angle))-this.d*sin((this.R+this.r)/this.r*this.angle);
  }
Outcome:
4. Code:
calculate() {
    this.x = (this.R+this.r)*(cos(this.angle)*2)-this.d*tan((this.R-this.r)/this.r*this.angle/2);
    this.y = (this.R-this.r*2)*(cos(this.angle))+this.d*tan((this.R-this.r)/this.r*this.angle);
  }
Outcome:

It is important to note that I did not have a design in mind that I found the code for. Rather, I took a basic math structure (the base formula) and altered and experimented with it. I wanted to see how far the equation can be taken, pushed beyond its limits, and by changing some of it parameters and characteristics (while keeping basic skeleton of the equation as it is), can we generate complex designs which are completely unexpected for its behaviour? And yes, that happened! I kept on experimenting with the values and functions until I found designs and patterns that I really liked and resonated with me. That is the part of the code I am proud of 🙂

PEN PLOTTING PROCESS

The pen plotting process was an absolutely fun process. I spent hours besides the plotter seeing my designs take form, changing the pen, putting the paper, changing the GoPro battery xD. Completely involved and engaged, I actually plotted 4 of my designs on the plotter and also prepared a matrix of some of my other designs also to be plotted.

Here is the outcome of my designs:

I had to change my code from plotting dots to lines for the pen plotter since we cannot plot a million dots on the plotter. I did this by using the concept of storing the previous position (x, y) of the dot and drawing a line between the previous and the current position each frame.

Here is the code for it:

draw() {
    this.calculate();
    if (dist(this.x, this.y, this.prevX, this.prevY) > width/4) {
      this.prevX = this.x;
      this.prevY = this.y;
    }
    stroke(0,50);
    // point(this.x, this.y); // initially I was just plotting a point at the current x and y
    line(this.x, this.y, this.prevX, this.prevY); // now plotting a line between previous (x, y) and current (x, y)
    this.prevX = this.x;
    this.prevY = this.y;
    this.angle += 0.02;
  }

There is not much difference in the code per say, but the effect and feel of the design definitely changed. I like both the versions! 🙂
Hence, I decided to randomise dots versus dashes in the final sketch.

A peak into the working of the plotter:

FURTHER DEVELOPMENT

I am very happy and excited with outcome of my project and now want to go ahead and look into other mathematical equations. Find other things in nature taht fascinate me, pick a different equation and yallah experiment with it! The golden ratio has often intrigued me and other equations like the logarithmic and archemedian spirals also have a lot to contribute to the field of design. I think I might pick a couple of equations together, nit just one and superimpose those like we did with the sin waves in class. It’ll be interesting to see how other math equations behave and if the output we get is varied / distinct or actually we can generate similar patterns using other defining physical constraints?

Midterm Progress #2

Taking feedback from the presentation in class last time, I worked on 2 ideas this week to develop my midterm project.

IDEA #1

So, Inspired by the logarithmic spiral I discussed in the last post, I sketched a design I wanted to try implementing with p5. The design (sort of inspired by hena designs and sort of by fountains) can be found below:

I wanted each of these spirals to emerge from the center in sequencial order to create a performance of sorts – like in fountain or light shows.

I started by implementing just one spiral. The equation for a logarithmic spiral in polar coordinates is given by (where theta varies over time):

r = a * e ^ (theta * sin(b))

It took some playing around with the values of a, b, e to get results that matched my design. This is how it looked:

Then I started adding more than one spiral. I ran into problems here because I was trying to use the same a, e, b values for both while each updated separately, so it gave runtime errors. I then switched to creating classes for each of the spirals so it could have its own data members which could be updated independent of others.

After iterating through many intermediate process designs, I finally reached the desired output, yayy!

Version 1:

Version 2:

Version 3:

All thought I love this pattern, it is not really generative art. The full design of the performance is clearly thought out and coded to pan out like this only always. So, I will have to see what to do with this further and where to take it.

It did try to give it a bit of autonomy by randomising the direction change:

IDEA #2

Besides the above logarithmic pattern idea, I also used the last week to further build on my other idea of spirographs and somehow fuse all the designs together. Inspired by the feedback I got in class, I thought of implementing user interactivity to change parameters of the formula which are rendering such varied designs as shows last time. My idea was that each time user clicks on the screen, the values are randomly generated, to give me new design, with a new color, drawn on top of the previous one, hoping to create even more unique and wonderful patterns.

However, unfortunately, it turned out to be a #completefail :(( These idea and the patterns thus generated look so bad. It completely takes away from the aesthetics of the design and just looks like chaos. It does not seemingly fuse the designs at all as I had imagined. I will have to think of something else to do with this or a more unique and interesting way to get all of this together.

Here are a few pictures of the output:

Here is the sketch:

GOING FORWARD

So, the first idea has to be rejected because even though I am using randomness, I do not think it qualifies as generative art. Though I had a lot of fun experimenting with it! 🙂

I will work on the second idea but will not combine different shapes to be generated over each other. I am thinking of having one design itself and experiment with the parameters in it and give the user the choice of clicking on the screen to generate a new design (after wiping out the previous one). I just have to work further on the code to generate designs that really resonate with me. The idea and works are still developing and I would like feedback on this in class to work further.

UPDATE

Yay! So, while working further on our midterms in class, I discovered / generated this design! I absolutely love it and want to go ahead with this / finalize this as my midterm submission and the pen plotter design.

I love ghe above design, the dots have a sort of mystical effect to it. However, we cannot plot a million dots on the plotter so I will be changing the dots to lines using the concept of storing the previous position (x, y) of the dot and drawing a line between the previous and the current position each frame. It’s interesting how just changing from dots to lines, the feel of the design changes – this one is not mystical, rather bolder, more architectural and defined. I love this too! 😀

I also got feedback from the professor on the idea of the mouse click, though not needed, but is good to implement to show variation and the different designs that can be created. So, I will be working further on that. I am not sure how to apply a function (say sin, or cos, or tan) randomly to a value without hardcoding it. That is what I am currently trying to figure out and let’s see how it goes!