Sand AISand AI MAGI-2MAGI-2 が SandBase に登場しました: ネイティブ音声付き 1080p 動画今すぐ試す

Three.js Character Motion

Create a jointed explorer with camera-relative movement, a terrain-following gait and collision sliding.

例

Three.js Character Motion
新しいタブで開く

Three.js Character Motion

この例はサンドボックス化されたフレームで実行され、このページにはアクセスできません。

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

得られるもの

A standalone explorer scene with rolling terrain and two stone obstacles. Procedural walking and running, terrain-following feet and collision sliding. Camera-relative input, orbit controls and movement regression tests.

仕組み

  1. 01

    Create the walking example

    Three.js Character Motion creates its runnable project with node scripts/new-project.mjs --out ./my-character-motion, which requires a new directory. Then run npm ci, npm test, npm run dev and npm run build. A clothed explorer crosses a rolling meadow past two stones: WASD runs, Shift walks and dragging changes the view. Node.js 22.12+ and a GPU-capable browser are required.

  2. 02

    Adapt terrain, scale and garments

    Change terrain, obstacles and camera framing in sources/demo.js, and character scale and walk or run speeds in explorer.js. The cap, backpack and garments each have their own module. The ground sampler returns world-space surface height, and feet and pelvis adjustments follow the character scale convention. references/integration.md documents the API contracts.

  3. 03

    Feed real movement and verify

    Pass the actual post-collision displacement to explorer.update; passing intended velocity makes the feet slide. That is why a blocked explorer settles instead of running in place. After changes, run the affected tests, then check the browser entry, movement and the requested viewport. A build proves bundling only, while browser inspection proves the visual gait.

FAQ

What does Three.js Character Motion animate?

Three.js Character Motion animates a procedural stylized explorer with a jointed gait, terrain-following feet, camera-relative movement and collision sliding. It covers ground locomotion only. Swimming and climbing need separate animation and control work, and the character is a procedural mesh with joint and garment animation.

Does Three.js Character Motion use any paid service?

No. Three.js Character Motion runs entirely in the browser from local source, with no model calls or API keys, so nothing is billed. Its pinned npm dependencies download during npm ci. The example's language selector switches the interface between Chinese and English.

Why do feet slide in Three.js Character Motion?

Feet slide in Three.js Character Motion when explorer.update receives the intended velocity instead of the movement left after collision. Pass the real displacement and the gait matches the ground. A blocked character then settles in place instead of running against the obstacle.

Can I drop Three.js Character Motion into my own game?

Yes. Three.js Character Motion is self-contained: the full example is in assets/project, with source under sources/archipelago and a small standalone integration in sources/demo.js. Copy or edit those modules inside your project, and keep assets/project/LICENSE and references/source-manifest.json with them.

What licence covers Three.js Character Motion?

Three.js Character Motion includes MIT-licensed code. The MIT licence and a source manifest ship with the package, so keep both when you ship a project built on it.

Does the Three.js Character Motion preview save my place?

The Three.js Character Motion preview remembers where you are only for the current session; reloading the embedded page resets it. Once downloaded, the project uses local browser storage.

Lab Skill · 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.

Lab Skill · 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.

Lab Skill · 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.

Lab Skill · 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.

Lab Skill · 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.

Lab Skill · 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.