Starfield Warp

Infinite starfield moving towards the camera with wraparound.

Key topics: three.js, retro, starfield, demoscene, particles

What this code does

- Points distributed in a box fly towards the camera along -Z.
- When stars pass near the camera they wrap back to the far plane.
- Speed parameter scales per-star velocities for warp-like motion.

Continue Learning

JavaScript Implementation

ES6+
// Create starfield points and move them along -Z, wrapping when close