Sand AISand AI MAGI-2MAGI-2 अब SandBase पर है: 1080p वीडियो, नेटीव ऑडियो के साथअभी आज़माएँ

Procedural Fish Swim

A school of procedural fish rides a closed spline through an underwater scene — chain spines bend under per-joint angle constraints, fins and tail fan follow the total bend. Surrounding them: kelp sway, rising bubbles, drifting motes and god-ray shafts. One JSON sheet drives fish kinds, lanes, captions and palette.

उदाहरण · 2

ऑनलाइन चलाएँ

मुफ़्त

SandBase sandbox में Procedural Fish Swim के उदाहरण को चलाएँ और परिणाम यहीं देखें।

यह कैसे काम करता है

  1. 01

    Write the sheet

    Describe the scene in one JSON sheet: size, frame rate, duration and seed, a closed Catmull-Rom loop of points in 0 to 1 frame coordinates, and the fish that ride it. Each fish has a kind (stream, reef, eel or koi), scale, lane, speed and palette. Add counts for motes, bubbles, weeds, rocks and light shafts, plus captions. kelp-reef-en.json is a bundled 30 s reef example.

  2. 02

    Build and preview stills

    Run npm install with Node 22 or newer, then node scripts/build.mjs sheet.json --out build. The build validates the sheet and writes a self-contained index.html with vendored GSAP and inlined fonts that needs no network. node scripts/stills.mjs --build build --at 2,5,9 writes a contact sheet in headless Chrome, which is much faster than rendering the full film.

  3. 03

    Render and verify the film

    node scripts/render.mjs --build build --out film.mp4 renders a silent H.264 film through HyperFrames, then checks the codec, the size against the manifest, the duration within 0.25 s and a full decode, and writes a JSON report. The film is deterministic, so the same sheet renders identical frames again. Everything is drawn procedurally; the Skill calls no model.

FAQ

How do the fish in Procedural Fish Swim move?

Each fish in Procedural Fish Swim is a 12-joint chain spine pulled along the loop. The head rides the spline, and every joint behind it sits a fixed arc length back with a lateral wave that grows toward the tail, so the swim wave travels from head to tail. Fins rotate with the local spine angle, and the tail fan widens with the total bend.

Is Procedural Fish Swim a physics simulation?

No. Procedural Fish Swim moves its fish kinematically: the chain is rebuilt from the loop position on every frame, with no muscle model and no water resistance. It is a 2D side view with no perspective or true 3D. Because each frame depends only on its time, backward seeks replay exactly and the film is reproducible.

Which fish can Procedural Fish Swim draw?

Procedural Fish Swim has four body plans, stream, reef, eel and koi, which set the joint count, width profile and fin size. Each fish takes its own body, belly and fin colours, an optional stripes, spots or koi pattern that bends with the spine, a plumpness from 0.5 to 2 and its own weave amplitude and frequency.

Why does a fish body pucker in Procedural Fish Swim?

A very tight loop makes the body pucker. Procedural Fish Swim keeps each fish on its spline, so sharp hairpins bend the spine more than its joints can follow smoothly. Smooth out the loop by spacing its control points more evenly, or lower that fish's speed, until no kink shows in the stills.

What output does Procedural Fish Swim produce?

Procedural Fish Swim produces build/index.html with manifest.json, a self-contained page with no network use, and film.mp4, a silent H.264 film at the sheet's frame rate and size. The sheet accepts even sizes from 320 to 3840 pixels, 12 to 60 fps and durations from 3 to 300 seconds, with English or Chinese captions.

Does Procedural Fish Swim have sound?

No. Procedural Fish Swim is silent by design and renders no music, narration or effects. Add your own score in an editor after rendering. The Skill draws every fish, plant and light shaft procedurally from the sheet, and it copies no third-party code, fonts or footage into the film beyond its licensed bundled fonts and GSAP.