Amal – Assignment 3

Concept

This project explores how small particles in nature respond to invisible forces in their environment. I was inspired by drifting pollen, spores, and algae suspended in water. These natural elements do not move randomly. They respond to forces such as gravity, air currents, and nearby bodies.

Using the attractor and mover structure introduced in class, I reinterpreted the system as an ecological field. The attractors function as environmental centers of influence. The movers behave like pollen particles that continuously respond to these forces. Instead of presenting a physics demonstration, the system is used to generate an evolving visual pattern.

The visual accumulation of trails transforms the physical simulation into a generative design.

Code Highlight

One section I am particularly proud of is the gravitational force calculation inside the attractor. This formula controls how each particle responds to distance and mass, and it was important to balance it so that movement felt stable but still dynamic.

This part connects directly to the force and acceleration principles explored in class.

let force = p5.Vector.sub(this.pos, mover.pos);

let distance = constrain(force.mag(), 20, 250);
force.normalize();

let strength = (this.G * this.mass * mover.mass) / (distance * distance);
force.mult(strength);

return force;
Code

Milestones and Challenges

Scaling the system from a single mover to many movers was an important milestone, as it shifted the focus from isolated motion to collective behavior. Maintaining stability while multiple forces acted simultaneously required careful adjustment, especially to ensure smooth and continuous motion across the canvas. Refining the visual output so that movement accumulated into a coherent pattern was also part of the development process. The main challenge was balancing the strength of attraction. When the force was too strong, particles collapsed into tight clusters, and when it was too weak, the system lost cohesion. Fine tuning the relationship between force strength and distance was necessary to achieve controlled but organic motion.

Reflection and Future Improvements

This project demonstrates how simple force based rules can generate complex collective behavior. Even though each particle follows the same physical logic, their interactions create layered and evolving patterns.

In the future, I would explore introducing interaction or additional forces to create more spatial variation. I am also interested in experimenting with alternative visual mappings to further strengthen the natural aesthetic.

Amal – Assignment 2

Inspiration

Concept

For this assignment, I chose to simulate the movement of a moth attracted to a lamp, inspired by how insects behave around light sources in nature. When observing moths, their motion is rarely direct or smooth; instead, it feels hesitant, wobbly, and slightly chaotic.

The goal of this sketch was to recreate that behavior using only acceleration-based forces, without relying on complex visuals. The personality of the moth comes entirely from how it moves rather than how it looks.

The lamp acts as a constant attractor, while a subtle wobble force gives the moth an organic, fluttering quality.

Code Highlight

The part of the code I am most proud of is the wobble (flutter) force, which adds personality to the moth’s movement without making it feel random:

this.wobble += 0.1;
let flutter = createVector(
  cos(this.wobble),
  sin(this.wobble)
);
flutter.mult(0.03);
this.applyForce(flutter);

This small oscillating acceleration creates a natural, insect-like flutter. Combined with the attraction to the lamp, it makes the moth feel alive and slightly unpredictable, rather than robotic. And, this is where I used ChatGPT’s to help.

The Code

Reflection & Future Work

This project helped me better understand how simple rules can create believable natural motion. Using acceleration alone forced me to think carefully about how each force affects the behavior over time.

What worked well:

  • The combination of attraction and wobble felt natural and readable.
  • Limiting speed and force helped keep the movement smooth.
  • Keeping visuals simple allowed the motion to stand out.

If I were to continue developing this sketch, I would:

  • Add a “panic zone” near the lamp where the moth starts circling instead of approaching directly.
  • Introduce multiple moths with slightly different parameters to give each one a unique personality.
  • Experiment with a pulsing or moving light source to see how the behavior adapts.

Amal – Assignment 1a

The Computational Beauty of Nature – Ch1

The concepts explored in this reading were very central to how we view things and analyze not only nature but also human-made systems like the stock market. What left a strong impression on me is how important it is to analyze interaction in order to truly understand what something is. At the beginning of this chapter, Flake introduces the idea of reductionism, which is the process of reducing something into increments to better understand its true nature.

In my understanding, we are invited to look at this from a rather “scientific” lens in order to see how we could apply a similar concept in computing. This leaves me with the impression that it is very important for us to first understand how dissecting something in terms of meaning can then help us introduce that understanding to a computer.

The Concept

My concept is inspired by fireflies. Having never experienced them, I have always been curious about what it would feel like to interact with one, so why not simulate it?

For the sake of simulating human-to-firefly interaction, I did not want the firefly to simply float around randomly. I wanted it to follow the mouse around the sketch in order to translate a sense of curiosity between both the firefly and the user.

I implemented a Gaussian random walk (List 1) and mapped the motion to color and brightness to create a firefly glow effect (List 2).

Code that I am proud of
let glow = 220 + randomGaussian() * 20;
glow = constrain(glow, 140, 255);

I’m proud of this part of the code because I wanted the firefly’s glow to feel as natural as possible. Using Gaussian randomness makes the brightness fluctuate gently instead of jumping unpredictably, and constraining the values keeps the light within a realistic range.

The Sketch

Reflection

Initially, I wanted to mimic bacteria and binary fission, but that idea felt a bit too ambitious at this stage. I decided to step back and focus on exploring motion in a simpler way, which led me to this firefly concept. I was interested in creating something that felt organic and calm rather than complex.

For future work, I wanted to place the firefly over an image of a forest, but I realized that doing so would either cause the firefly’s trail to disappear or require the background to fade over time. I think finding a way to balance a real forest image with the artificial movement of the firefly could be an interesting direction to explore further.