Every bird follows three local rules - avoid crowding, match the heading of neighbours, stay with the group. No leader, no plan: the swirling flock emerges from the rules.
The science
Reynolds rules (1987). For bird i with neighbour set Ni the steering acceleration is a = amax[ ws Σ(ri-rj)/|rij|² + wa(〈vj〉 - vi)/v0 + wc(〈rj〉 - ri)/Rc ], then speed is relaxed toward v0 and clamped to 0.55-1.45 v0.
Topological neighbours. Ballerini et al. (2008) measured starling flocks in 3D and found that each bird interacts with about 7 nearest neighbours regardless of distance, not with everyone inside a fixed radius. That keeps flocks cohesive when density changes. The neighbour search here uses a spatial hash grid (cells of 6 m) and is verified against brute force.
Order parameter. Polarisation φ = |Σ vi/|vi|| / N is 1 for perfectly parallel flight and about 0.92/√N for random headings in 3D.
Banking. Roll follows lateral acceleration, θ = atan(alat/g), smoothed with a 0.17 s time constant. Wing beats are a visual effect, not aerodynamics.
Honest simplifications. Point-mass birds, no aerodynamics, no vision cone, no wind, constant bird size (visual size is scaled up so you can see them). Real murmurations also show scale-free correlations that this model only partly reproduces. The hawk is a simple pursuer that never catches anyone.
Models. Starling, hawk, willow, alder, reeds, boardwalk and bird hide were made in Blender (named parts, baked textures, Draco GLB).