- NATURE OF CODE -

REFLECTION

RESEARCHING

How can natural structures be translated into written code? What should one focus on – the physical properties or the visual ones? To find out, the Digital Foundations course from HBK Braunschweig spent a week on Amrum, a small island in North Frisia. On the first evening, I walked across the dunes to the sea. Once I had climbed over the sand hill, the endless beach and mudflats stretched out before me. I was forced to walk a long way to reach the water. Along the way, I immediately noticed something: how many different kinds of structures the beach can have.

STRUCTURES

In the first step, my goal was to translate the visual properties of the beach's structures into code. I quickly realized that these structures can be distinguished by two rather subtle characteristics: the spacing between the lines and the way the lines themselves flow – whether they are more straight or wavy. In my code, these properties can be adjusted using the variables let spacing and let noiseScale. Here, let spacing defines the distance between the lines, and let noiseScale describes their flow.

SAND1
let spacing = 15; 
let noiseScale = 0.05;
SAND2
let spacing = 3; 
let noiseScale = 0.05;
SAND3
let spacing = 3; 
let noiseScale = 1;
SAND4
let spacing = 4; 
let noiseScale = 0.02;
SAND5
let spacing = 4;  
let noiseScale = 0.02;

NO SECOND LOOP FOR CONNECTING LINES
NO INTERRUPTIONS IN THE LINES

PARTICLE SYSTEM / WATER

But how do these different structures come into being? Through my observations, I noticed that they all share one thing in common: they are formed by the constant movement of water. In some cases, water flows through the structures, following the path of least resistance; in others, it deposits more and more sand, which accumulates over time. To translate not only the visual but also the physical properties, I used a particle system to simulate water flowing over sand, generating these structures.

The particles in this simulation represent water droplets that rise due to a strong upward buoyant force. Their movement is controlled by a maximum speed, ensuring realistic dynamics. The particles have a lifespan, which determines how long they stay active before being removed from the system. When colliding with the background lines, which act as barriers, the particles are reflected, with their velocity being adjusted for a realistic response. If the line is slanted upwards, the particles also receive a tangential boost, enhancing their movement along the line. If a particle becomes nearly stationary due to low velocity, a release force is applied to get it moving again. The particles randomly respond to their environment, mimicking the chaotic and unpredictable behavior of water droplets. Overall, the simulation creates a dynamic and realistic representation of how water droplets interact with various forces.

SAND 1

SAND 2

SAND 3

SAND 4

SAND 5

PARTICLE SYSTEM / WATER