Stars are placed in 3D space distributed in a disk around the origin. Each frame their Z coordinate decreases, moving them toward the camera, and they are projected onto the screen with simple perspective division. The streak each star leaves is drawn as a line from its previous projected position to its current one.
The camera doesn’t move. Instead, each star’s world position is rotated every frame by the current camera angles, which is equivalent to rotating the view. The angles accumulate through a three-stage damped system: random noise feeds into angular acceleration, which feeds into velocity, which feeds into the angle. Each stage is damped by 0.92, so the camera drifts with a slow, momentum-heavy quality rather than spinning freely.
The original was built for Android with only 20 stars for performance. This version defaults to 600.
Adapted from a Processing sketch originally made in February 2011.