Sketch:
Concept: My project is an interactive digital artwork that simulates the movement and appearance of algae in a swamp environment. Inspired by what I have seen in my home country many times, it aims to capture the flow of algae in a river. I used different methodologies to create a dynamic, visually interesting scene that mimics the organic, flowing nature of algae. By incorporating various elements such as multiple algae clusters, water particles, and background rocks, I tried to recreate a cohesive river like ecosystem.
Inspiration: The inspiration for this project came from my trip to Dashbashi Mountain in Georgia. I saw algae flowing in a river near the waterfall, and it was very pretty, almost from a fantasy world. This happened very recently so it was the first thing that came to mind when I was thinking about this project. This brief encounter with nature became the foundation for my work, as I tried to translate the organic movement of algae and water into an interactive digital format.
IMG_7042 – Short clip of moving Algae
Process of Development: I developed this project iteratively, adding various features and complexities over time:
At first I visualized the algae movement. I realized it had to do something with waves and sinusoidal shapes were first thing that came to my mind. Unfortunately, few hours in implementation I realized assignment specifically asked for acceleration. Soon after implementing acceleration, I realized this movement alone limited me in creating algae flow so I had to go back and forth multiple times to get at result that somewhat resembled the movement while using acceleration. Unfortunately, I did not find any definitive tutorials of such movement. As such this is more of a strand like simulation which I slowly built up, line by line, also looking at other works like hair movement for inspiration, I will mention them in references.
These screenshots are from earlier development of the simulations:
As you can see by adding various parameters to each strand as well as overall cluster, we are able to achieve similar wavy pulsating pattern that algae have. I also added particle systems and noise-based algorithms for water movement (you can see inspiration of this from reference). To enhance the environment, I included rock formations and a sky. I integrated sliders and toggles for user interaction. Finally, I kept refining values till I achieved desire perfomance and visuals. The simulation is pretty heavy to run and you can expect drastic FPS drops, based on number of strands we are running. Water simulation is a significant culprit here despite multiple scaling that was needed to achieve even that.
How It Works:
Algae Simulation: I created multiple clusters of algae strands, each with unique properties. I animate each strand using sine waves and apply tapering effects and clustering forces for a more natural-looking movement. I also calculate acceleration and velocity for each strand to simulate fluid dynamics.
Water Effects: I used a particle system to create the illusion of flowing water, with Perlin noise for natural-looking movement. I applied color gradients to enhance the swamp-like appearance. There is also background audio of waterfall that helps the immersion.
Environmental Elements: I drew rocks using noise-based shapes with gradients and added a toggleable sky for depth.
Interactivity: I included multiple sliders that allow users to adjust various parameters in real-time.
If you want to know more about in depth working and how everything is related, it will be better to check out my code as it is commented thoroughly.
Code:
One piece of code I’m particularly proud of is the function that generates and animates individual algae strands:
function algae(strandPhase, strandLength, strandAmplitude, clusterEndX, clusterPulsePhase) {
beginShape();
let taperingPoint = taperingPointSlider.value() * strandLength;
let taperingStrength = taperingStrengthSlider.value();
for (let i = 0; i <= strandLength; i += 10) {
let x = i;
let y = 0;
let progress = i / strandLength;
let taperingFactor = 1;
if (i > taperingPoint) {
taperingFactor = pow(map(i, taperingPoint, strandLength, 1, 0), taperingStrength);
}
let currentAmplitude = strandAmplitude * (1 - progress * 0.8) * taperingFactor;
let movementFactor = sin(map(i, 0, strandLength, 0, PI));
let movement = sin(strandPhase + i * 0.02) * currentAmplitude * movementFactor;
let angle = map(i, 0, strandLength, 0, PI * 2);
x += cos(angle) * movement;
y += sin(angle) * movement;
let curvature = sin(i * 0.05 + phase + clusterPulsePhase) * 5 * (1 - progress * 0.8) * taperingFactor;
y += curvature;
let clusteringForce = map(i, 0, strandLength, 0, 1);
let increasedClusteringFactor = clusteringFactor + (progress * 0.5);
x += (clusterEndX - x) * clusteringForce * increasedClusteringFactor;
vertex(x, y);
}
endShape();
}
This code incorporates acceleration and velocity calculations to simulate realistic fluid dynamics, creating more natural and unpredictable movement. The function also creates a tapering effect along the strand’s length, generates wave-like movement using sine functions, and applies a clustering force to mimic how algae clumps in water. I’m especially pleased with how it combines mathematical concepts like acceleration, sine waves, and mapping with artistic principles to create a visually appealing and believable representation of algae in motion. The integration of user controls allows for real-time adjustment of parameters like acceleration strength, making the simulation highly interactive and customizable.
Challenges:
Balancing visual quality with smooth performance was tricky, especially when animating multiple elements at once. Getting the algae to move naturally in response to water currents took a lot of tweaking. The water particle system was also tough to optimize – I had to find ways to make it look good without slowing everything down. Another challenge was making the user controls useful but not overwhelming.
Reflection:
This project was a good learning experience for me. I enjoyed turning what I saw at Dashbashi Mountain into a digital artwork. It was challenging at times, especially when I had to figure out how to make the algae move realistically. I’m happy with how I combined math and art to create something that looks pretty close to real algae movement. The project helped me improve my coding skills and while it’s not perfect, I’m pleased with how finished product looks.
Future Improvements:
Speed it up: The simulation can be slow, especially with lots of algae strands. I’d try to make it run smoother.
Better water: The water effect is okay, but it could look more realistic.
Add more stuff: Maybe include some fish or bugs to make it feel more like a real ecosystem.
References:
p5.js Web Editor | Blade seaweed copy copy (p5js.org)
p5.js Web Editor | sine wave movement (hair practice) (p5js.org)
p5.js Web Editor | Water Effect (p5js.org)
YouTube
Internet