# Jet Ski Ocean

A Three.js jet ski simulation on an endless, animated ocean. Everything (waves, sky, jet ski, wake, spray, UI) is generated in code. There are no models, textures or HDRIs. Three.js r160 loads from the jsDelivr CDN.

## Run

No build step. Serve this folder and open `index.html`:

    python3 -m http.server 8000     # then open http://localhost:8000

## Controls

| Action | Keyboard | Touch |
|---|---|---|
| Throttle | `W` / `Up` | Throttle slider (right). It holds its position, so drag it to the bottom to cut power |
| Brake / reverse | `S` / `Down` (brakes while moving forward, then reverses gently) | BRAKE button (also zeroes the throttle) |
| Steer | `A` / `Left`, `D` / `Right` | Steering stick (left), horizontal axis |
| Reset upright | `R` | RESET button (top right) |
| Sea state | Slider in the HUD, calm to stormy, changes wave height live | same |

The HUD shows speed in km/h and an AIR tag while the craft is off the water.

## How it works

- **Waves:** a sum of 6 directional waves with peaked crests, plus fine ripples that only affect shading. The same formula runs in the GLSL shaders and on the CPU, so the hull rides exactly what you see. Sea state scales the amplitudes.
- **Buoyancy:** 8 hull sample points each push up in proportion to their depth below the surface, with damping and a slope push. This produces pitch, roll, heave, airtime and slam-downs.
- **Steering:** thrust is aimed by a steering nozzle, so steering weakens without throttle. Steering also adds a lean-into-the-turn torque. Sideways grip falls off with speed, so the craft drifts in fast turns.
- **Effects:** a foam wake ribbon behind the stern, spray particles from the bow and a rooster tail that scale with speed, and a splash burst plus camera shake on landing.
- **Camera and sky:** a smooth chase camera that pulls back in portrait, a sky dome with sun and clouds, and distance haze so the sea fades into the horizon.
- **Performance:** resolution scales adaptively to hold the frame rate. Phones get fewer particles and a coarser ocean mesh.
