Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Three.js Ocean Sailing

Build depth-colored water, shoreline swash and a buoyant boat with steering, braking and a persistent wake.

Exemple

Three.js Ocean Sailing
Ouvrir dans un nouvel onglet

Three.js Ocean Sailing

L’exemple s’exécute dans un cadre sandbox sans accès à cette page.

Start with the complete archipelago, or take one system into your own Three.js game. Each Skill includes a standalone project.

Ce que vous obtenez

A standalone coastal sailing scene with a small island. Rapier boat physics, depth-dependent water, shoreline swash and boat wake. An orbit camera, keyboard steering and targeted regression tests.

Fonctionnement

  1. 01

    Launch the island and boat

    Three.js Ocean Sailing creates a project with node scripts/new-project.mjs --out ./my-ocean-sailing, followed by npm ci, npm test, npm run dev and npm run build. A small grass-and-sand island has a fishing boat that sails into deeper water: W and S drive, A and D steer, Shift boosts, Space brakes and dragging orbits the camera.

  2. 02

    Tune water, waves and islands

    Edit the island list and boat spawn in sources/demo.js, ocean colours in art-direction.js and wave parameters in ocean.js. The boat pitches and rolls on the same wave spectrum as the water shader, so keep heightAt, minimumHeightAt, depth attenuation and GPU displacement consistent. Move shoreline geometry and collision together, and reset wake particles after a teleport.

  3. 03

    Keep physics stable and verify

    Preserve the fixed-step Rapier update with its bounded substeps. The sailing area is bounded to x from -210 to 210 and z from -230 to 120, so widen bounds and recovery targets deliberately for a bigger world. Run the affected tests, then sail in the browser at the requested viewport and record measured frame rate with device and browser.

FAQ

What does Three.js Ocean Sailing simulate?

Three.js Ocean Sailing simulates depth-dependent water colour, shoreline swash, a persistent wake and a drivable buoyant boat on a bounded stylized wave model. It is a coastal sailing scene and boat physics prototype, and its physics keeps a home-port convention with harbour helpers.

Does Three.js Ocean Sailing call any AI model?

No. Three.js Ocean Sailing is a Three.js and Rapier project that runs in your browser, with no model calls and no API keys, so sailing and editing it is not billed. npm fetches its pinned dependencies once at install time.

What must stay in sync in Three.js Ocean Sailing?

Three.js Ocean Sailing needs heightAt, minimumHeightAt, depth attenuation and the GPU displacement to stay consistent, because the boat floats on the same wave spectrum the shader draws. Check them together after changing anything in ocean.js.

Can I make the Three.js Ocean Sailing world bigger?

Yes, deliberately. Three.js Ocean Sailing inherits a sailing area bounded to x from -210 to 210 and z from -230 to 120. Expand those bounds and the recovery targets together when integrating a larger world, and move shoreline geometry with its collision so the boat cannot pass through land.

What browser does Three.js Ocean Sailing need?

Three.js Ocean Sailing needs a current GPU-capable browser, plus Node.js 22.12 or later to build. Open the loopback URL that Vite prints. A selector in the demo toggles Chinese and English, and the deliverables are the project and its built dist folder.

Does the Three.js Ocean Sailing preview save anything?

Three.js Ocean Sailing's sandboxed preview holds its state for the current session, so a reload begins again from the start. Downloaded projects keep their state in local browser storage.

Skill Lab · Games

Seagull Swoop

Build a 3D flight-and-delivery game with light fries, heavy fish, crosswinds and optional ring routes. The gull must bring lunch home; cargo weight changes which openings it can safely reach.

Skill Lab · Games

Wedding Cake Wobble

Build a 3D fragile-cargo delivery game around a wobbling wedding cake. Brake before turns, avoid crossing guests and steer around tables. Lost tiers change the score, while a partial delivery can still succeed.

Skill Lab · Games

Hermit Tide

Build a 3D route-and-timing game where a hermit crab changes shells to cross a tidal shore. Narrow gaps favour the cap, stronger shells resist waves, and dry stones provide shelter and checkpoints.

Skill Lab · Games

Clover Circuit: Estate Cut

Drive a coral ride-on mower through a fenced estate garden. Steering, braking and the moving blade cut actual grass tufts; Overview reveals the genuine trail. Edit three gardens and three scene palettes offline. Coverage counts trimmed tuft centers rather than continuous ground area.

Skill Lab · Games

Glide Gates: Lagoon Run

Flap a golden bird through emerald pipe pairs above a turquoise lagoon. Actual fixed-step gravity, swept circle contacts and full-gate scoring power both manual flight and clearly labeled practice. Edit three courses and three scene palettes offline.

Skill Lab · Games

3D Interactive Garden Islands

Walk a curved garden, harvest fruit, share gifts, catch butterflies, fish, grow flowers and craft furniture. Four lighting states and one offline HTML with bilingual keyboard and touch controls.