HomeEcology & Conservation BiologyVision-Based Fish Schooling (2D Ray-Cast Occlusion + Startle Cascade)

Vision-Based Fish Schooling (2D Ray-Cast Occlusion + Startle Cascade)

Interactive 2D fish-schooling simulator: occlusion is resolved by rasterized ray-casting instead of the 3D version's analytic bearing-interval sweep, close-range avoidance uses time-to-collision (tau) rather than plain inverse-distance repulsion, and a single-fish startle measures how fast the fright response propagates through the school as a real regression-fit wave speed.

Ecology & Conservation Biology2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-fish-schooling-vision-based-alignment ↗ Open standalone

This 2D companion to the 3D vision-based schooling simulator keeps the same underlying idea — alignment driven by a limited field of view with line-of-sight occlusion, not omnidirectional metric sensing — but computes and measures it independently. Occlusion here is resolved by rasterized ray-casting rather than the 3D model's analytic bearing-interval sweep; close-range avoidance is driven by time-to-collision (τ) rather than plain inverse-distance repulsion, a real biologically-documented collision-avoidance variable; and a single-fish startle lets you measure — via a live regression fit — how fast the fright response actually propagates through the school as a wave, the same quantity behavioral ecologists measure in real schooling fish. Tune blind-zone width, vision range, school size, turning agility and ray-casting resolution, then startle one fish and watch the cascade speed converge.

⚙ Under the hood

Interactive 2D fish-schooling simulator: occlusion is resolved by rasterized ray-casting instead of the 3D version's analytic bearing-interval sweep, close-range avoidance uses time-to-collision (tau, Lee's tau theory) rather than plain inverse-distance repulsion, and a single-fish startle measures how fast the fright response propagates through the school as a real regression-fit wave speed.

fish schoolingcollective behaviorfield of viewray castingocclusiontime to collisionstartle cascadeecology2D

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)