diff options
Diffstat (limited to 'examples/vecanim/README.md')
| -rw-r--r-- | examples/vecanim/README.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/examples/vecanim/README.md b/examples/vecanim/README.md new file mode 100644 index 0000000..cc6dc0e --- /dev/null +++ b/examples/vecanim/README.md @@ -0,0 +1,39 @@ +# 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: click, space or page down for the next step of a scene that pauses +(space plays and pauses one that does not), page up back a step, `]`/`[` +next/previous slide, P play/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 runs on while a pause waits, + 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. |
