/ghibli-threejs:threejs-boat-buoyancy-steeringfrom ghibli-threejs
Floats a boat on three.js water with Gerstner waves, CPU/GPU shared wave height, damped heave/pitch/roll springs, drift lane, click-to-steer rowing, autopilot, and chase camera.
Ships in ghibli-threejs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A small rowing boat carrying {{character}} drifts downstream, rises and rocks on a gentle swell
that exactly matches the drawn water, swings round submerged rocks, and can be taken over by
clicking it (W/S row, A/D steer). Let go and after 3 s the autopilot steers back and rejoins its
lane. A chase camera rides along without stealing the orbit. Built for a three.js WebGL scene
whose water is a patched MeshStandardMaterial (see threejs-webgl-realistic-water); the same
logic runs in R3F useFrame. This takes the idea of a TSL/WebGPU "boat on waves" template and
applies it to an existing WebGL scene — rewriting onBeforeCompile patches in TSL isn't worth it.
Give
{{water}}a slow tide and a few Gerstner trains in the vertex shader, and float{{boat}}on them: sample the same height function on the CPU at the bow, stern, port and starboard. Heave follows the mean, pitch the bow–stern difference, roll the port–starboard difference, each through a damped spring. Lily pads, lanterns and the camera's waterline guard use the same function.Add a small wooden rowing boat carrying
{{character}}, drifting downstream. Smooth motion: a lane offset from the centreline that bends round submerged rocks and is smoothed, constant m/s along it (slower where the visitor looks), heading eased late, a gentle bob/roll/pitch, fish that give it room. Click{{boat}}to take the helm: W/S row, A/D steer, momentum and water drag, a rudder that bites with speed, soft collisions with banks and rocks. After 3 s without input the autopilot steers back and rejoins its lane smoothly. While steering, glide the camera to a chase framing behind{{character}}(about 6 m back, 2 m up) with a little lag; dragging still looks round the boat, the wheel zooms, and after a drag hold the view ~4 s before easing back behind the stern over ~3 s. Never go through the bank or into the river. Hand back to the free orbit a few seconds after the autopilot has the boat again, or on Esc.
WAVES = [{dir, len, amp, speed, q}, …] + TIDE = {amp, period}. Normalise dir, k = 2π/len.
Generate waveDisp(p, t) (Gerstner: y += A sin θ, xz += qA·dir·cos θ) and waveSlope(p, t)
GLSL strings from the table, printing constants with toFixed(5); waveHeight(x, z, t) sums
the same sines on the CPU. GPU and CPU can't drift apart. See references/gerstner-waves.js.
River values that worked (a river isn't an ocean): four trains, 9.0/5.3/3.1/1.9 m wavelength, 2.2/1.4/0.8/0.5 cm amplitude, q 0.35–0.55, plus a 1.8 cm tide over 26 s. About 2–5 cm of swell plus 2 cm of tide reads as alive without flooding the deck or lifting lily pads over the banks. Expose a global amplitude in the Tune panel (both sides read it).
waveSlope × 1.3 to the ripple normal, or the light won't follow the swell.waveHeight(x, z), not y = 0.Probes 1.3 m fore/aft and 0.45 m port/starboard of the hull centre:
heave = mean(hB, hS, hP, hR), pitch = atan2(hB − hS, 2·1.3) + trim(0.02),
roll = atan2(hP − hR, 2·0.45). Each through a spring a = 16(x* − x) − 4.5v (≈ 0.6 Hz, settles
in ~1 s). Euler order YXZ; with the bow on local +X, rotation.z tips the bow and rotation.x
rolls. The character leans against the roll (−roll·0.6).
riverCenter(z) + offset every 0.5 m; push points away from obstacles
(need = r + 1.1, falloff over 1.8·need in z).[1 2 1]/4 smoothing, then CatmullRomCurve3(pts, false, 'centripetal').getPointAt/getTangentAt (arc length, so the speed is honest): 0.9 m/s open river,
0.24 m/s past where the visitor looks.atan2(−t.z, t.x) for a bow at local +X, eased min(1, dt·0.8) (a drifting boat swings a
little late) plus a slow wander 0.07 sin(t·.13) + 0.04 sin(t·.31).auto → manual → return → autov += (thrust·1.1 − v·0.35 − v|v|·0.22)·dt;
yaw rate eases toward turn · 0.9 · (0.35 + min(|v|, 1.2)) (rudder bites with speed).auto when offset < 0.3 m and heading error < 0.12 rad,
setting the arc length to that sample.need = r + 0.7, v *= 0.96).blur. Click = pointer moved < 6 px since down.See references/boat-helm.js (lane, helm, buoyancy) and references/chase-camera.js.
1 − exp(−dt·4.5). Carry the
camera by the same translation as the smoothed target, so OrbitControls keeps the user's offset.|v| > 0.15): relax only the azimuth relative to the heading
(rel *= exp(−0.55·swing·dt)); ease distance to 6.2 m (+1.4 m while boosting) and elevation to
the preferred tilt. A drag's final tilt becomes the new preferred elevation (clamped 0.03–1.2 rad),
so lowering the eye looks far downriver; a wheel zoom sets the preferred distance.smoothstep(since, 0, 3)).y ≥ max(terrain + 0.5, waveHeight + 0.35).autoRotate while following and restore it afterwards. If the autopilot loop teleports,
end the follow (or cut through a mist overlay) instead of flying across the world.Hang it plumb from a pole via inverse(hull world quaternion) × swing with a pendulum spring
driven by −acceleration/g — see threejs-night-lights-lanterns.
'\n' inside a JS template literal into a real newline and the page
died at 0% with Invalid or unexpected token. Escape it as \\n, or edit with a raw string.NaN,
which survives every later frame and hides meshes. Default inputs to 0 and reset non-finite state.OrbitControls.maxDistance silently clamps debug cameras; raise it for aerial checks.threejs-webgl-realistic-water · threejs-webgl-wake-simulation · threejs-night-lights-lanterns
· threejs-skeletonless-character-animation · threejs-fish-school-boids · threejs-open-world-streaming
· threejs-hud-objective-markers · threejs-object-interaction
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
31 skills in this plugin
/threejs-blender-glb-pipelineBuilds a reference-image-driven asset pipeline from headless Blender to GLB for a three.js scene — an asset contract (units, axes, grounding, required mesh/material names, budgets, attachment numbers), one parallel subagent per asset group writing craft_<slug>.py generators, preview renders compared against the reference, measured-bounding-box placement in the web scene, Draco compression, and a scored asset quality pass. Use when the user has a reference picture and wants a 3D scene from it, asks to model props/trees/characters in Blender for three.js, export GLBs, fix glTF export issues (vertex-colour alpha, UV flip, axes, custom normals), compress models, or rate and improve every asset in a scene./threejs-camera-guided-tourBuilds a hands-free guided camera tour for a three.js scene — keyframes as data, a time-parametrised Catmull-Rom (Hermite) path with continuous velocity, one camera-owner flag, the tour driving time of day and a day→night blend, staged creatures crossing the frame, handwritten captions, portrait-phone lens widening, instant hand-back on drag/scroll/tap/Esc, and a seek() hook for screenshots and video capture. Use when adding a tour mode, cinematic flythrough, attract mode, camera path animation, keyframed camera, spline camera or showcase video capture to a WebGL scene./threejs-cinematic-loading-screenBuilds a cinematic loading gate for a three.js scene — a painted CSS dawn (layered gradients, drifting blurred mist bands, optional conic god rays, SVG feTurbulence grain, vignette), a 2D-canvas layer of falling petals and glowing motes, a handwritten title that animates in, a gold progress line with stage captions, then "tap anywhere to enter" whose tap is the browser gesture that unlocks audio; uses a still captured from the live scene as the backdrop that cross-fades into the real render, and warms up shaders before lifting so the first interaction never stalls. Use when adding a loading screen, splash screen, intro curtain, preloader, tap-to-start / audio unlock gate or shader pre-compilation to a WebGL scene./threejs-day-cycle-lightingAnimates the sun in a three.js scene from sunrise to sunset through a single applySun(az, el) writer — azimuth sweep, elevation arc, warm-to-gold light colour, horizon falloff, warming sky dome and fog, re-aimed god rays and every sun-driven shader uniform — plus a cinematic "sun follows the lens" mode that keeps the sun beside the camera heading for backlit shots with boosted god rays and forward scattering. Use when adding a day/night cycle, time-of-day slider, sunrise/sunset, moving sun, backlit tour shots, or when several systems fight over the sun direction in WebGL/R3F./threejs-dreamy-glass-hudTurns a three.js scene's DOM overlay into one coherent, dreamlike HUD — a single frosted-glass material shared by every pill, badge and popover whose colours are registered CSS properties so the whole HUD cross-fades from pearl to deep indigo as the scene turns to night; an inline-SVG icon dock whose lit toggles glow gold instead of shouting; a glass popover in place of a native select; first-visit hints "whispered" in handwriting that step aside the moment the visitor understands; a HUD that drifts away after half a minute of stillness; a mote of light under each tap; a staggered arrival after the loading gate; and letterbox bars during a camera tour. Use when the overlay UI looks like a dev panel on top of a beautiful scene, when asked for a dreamy, cinematic, premium or 梦幻 / 绝美 UI, glassmorphism, a day/night-aware HUD, onboarding hints, auto-hiding UI, tap feedback, or to restyle lil-gui to match./threejs-first-person-bvh-walkLands a character on a landmark and lets the visitor walk it in first person in three.js — a floating-down arrival, the camera slipping from a three-quarter view into her eyes, WASD + pointer-lock look, Shift run, E use, V over-shoulder, Esc leave, a touch thumb stick, a levitation lift between floors, interiors lit by the nearest lamps — with a three-mesh-bvh capsule controller that never gets stuck (footprint ground, sideways-only capsule push-out, glancing along edges, climb-back for every drop, a breadcrumb unstick) and a headless flood-fill + random-wander soak test that proves it. Use when the user wants first-person or third-person walking inside a GLB building or island, WASD movement with collision, a character controller, pointer lock, or says the player gets stuck on walls, balconies, stairs, rails or seams.npx claudepluginhub nicksonthc/ghibli-threejs --plugin ghibli-threejs