One grain means almost nothing. Thousands of grains, responding to the same forces, become terrain. Move through it and the whole field reorganises around a tiny disturbance. This is an experiment about emergence: how simple units, relationships and local changes create something larger than any individual part.
These controls are wired into the main Grainfield above.
Turn a knob, then scroll back to the field. You are changing the equation that generates every grain: wave amplitude, spatial frequency, interaction radius, time speed, grain size and perspective. The point is to feel what each variable does before reading the explanation.
The grains are deliberately insignificant on their own. What you perceive as hills, valleys, colour bands and motion exists only because each point participates in a shared field. Disturb one area and nearby points respond differently according to distance. The object is not any grain. The object is the relationship between them.
This makes Grainfield a small visual model for systems we work with every day: teams, markets, knowledge graphs, software and communities. A local decision can alter a larger shape; patterns can emerge without a central designer; and changing your viewpoint can reveal structure that was already present but invisible.
There is no mountain object in the program.
JavaScript creates a grid of independent points. Every frame, each point asks the same function: how high should I be at this x, z and time? When thousands of answers are viewed together, your eye invents a continuous surface.
Grainfield is not a scientific fluid simulation. It borrows the language of waves: periodic displacement, interference and falloff. Two oscillations overlap, so some locations reinforce each other while others cancel.
Complexity appears when simple waves meet.
The important part is superposition: the final height is the sum of several small influences. That is the same broad idea behind overlapping water waves, sound pressure and many field-based simulations.
Move over the main field and points near you rise more than distant points. The effect fades with distance. This gives the interaction a physical intuition without running an expensive particle solver.
Influence has a radius. Proximity changes response.
The scene feels three-dimensional because JavaScript rotates each x/y/z point, calculates a depth value, then uses perspective to decide where and how large to draw it. Far grains become smaller and fainter. Near grains become larger.
Depth is not drawn. It is inferred.
This is why the experiment can look volumetric while staying in Canvas 2D. No Three.js and no WebGL scene graph are required.
The browser repeats the same pipeline about sixty times per second. First we sample the height field. Then we rotate and project each 3D point into screen coordinates. Finally Canvas 2D draws a tiny circle. Nothing is stored as a mesh.
The animation is a function being evaluated again and again.
Zoom mentally, not just visually. At one scale this is a collection of dots. At another it is a surface. At another it becomes a model for distributed systems.
The same data can tell a different story depending on the scale at which you observe it.
That is the final experiment: individual behaviour does not automatically explain system behaviour. Teams, markets, software architectures and communities all develop shapes that no single participant contains.