diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
| commit | 6933f99ddb2d7103515d26838496309a807bba26 (patch) | |
| tree | 991c2fe7d4a57957222876e190fa4d16a0fb889c /examples/vecanim/README.md | |
| parent | 82fca5c9f29124f37f6dcd08e73e6999ce44a69d (diff) | |
| download | sketchbook-6933f99ddb2d7103515d26838496309a807bba26.tar.gz sketchbook-6933f99ddb2d7103515d26838496309a807bba26.zip | |
Move standalone sketches into sketchbook examples
Diffstat (limited to 'examples/vecanim/README.md')
| -rw-r--r-- | examples/vecanim/README.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/vecanim/README.md b/examples/vecanim/README.md new file mode 100644 index 0000000..7627fe4 --- /dev/null +++ b/examples/vecanim/README.md @@ -0,0 +1,38 @@ +# vecanim + +Scenes for sketchbook's [`anim`](../../README.md#animation) +module: manim-style vector animation, with Typst for text and math, scenes +written as code (compiled, or live and interactive), cameras, morphs and +slide-style pauses. The library, its player and their tests live in +sketchbook; this package is the scenes, a script for each, and a +`build.zig` that lists them. + +```sh +zig build run # play scenes/intro.zig, with hot reload +zig build lib --watch # second terminal: save the scene, see it live +zig build run -Dscene=scenes/live.zig # any other scene file (and lib -Dscene=...) +zig build test # each scene played through its script, headless +zig build web # the same player in the browser (CPU renderer) +zig build export -- frames --size 1920x1080 # every frame as frames/000000.png, ... +zig build export -- - --size 3840x2160 --fps 60 | + ffmpeg -f rawvideo -pix_fmt rgba -s 3840x2160 -r 60 -i - -pix_fmt yuv420p intro.mp4 +``` + +Keys: space pause, click to continue after a `pause`, left/right +previous/next play, `,`/`.` step a frame, home/end, up/down speed, B GPU/CPU, +L loop, G guides (bounding boxes, origins and the scene's axes, with scene +coordinates and the pointer's); drag and wheel to look around, R to reset +the view. + +- `scenes/intro.zig`, compiled: shapes, Pythagoras morphing from one + equation to the next, a camera move with an updater swinging an arrow, + Typst math and a paragraph. +- `scenes/live.zig`, live, presented like slides: a wave of dots whose + height the timeline animates, whose phase is the wall clock, and which + rise to meet the mouse. + +`build.zig` lists the scenes with the script `zig build test` plays each +through (screenshots in `.zig-cache/e2e`). `-Dscene` picks the one `run`, +`lib`, `web` and `export` use. Each player is its own sketchbook app named +after its scene (`vecanim-intro`, `vecanim-live`), so several can run and +reload side by side with their own state. |
