summaryrefslogtreecommitdiff
path: root/src/anim/root.zig
Commit message (Collapse)AuthorAge
* anim: play's .lag staggers its animations, manim's lag ratio, 0 by defaultGabriel Schneider26 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option was read into every key (default 0.08) and never used. Now animation i of a play of n starts i * lag * each after the play does, each = seconds / (1 + lag * (n - 1)), so the last still ends with the play and the play keeps its length: manim's AnimationGroup run to a run_time. A lag of 1 is one after another. An object two animations of one play change moves with the first (Change.at); the camera with the first camera animation. Compiled and live scenes agree: a live play shows an animation from its own key's start, as the compiled lookup does. Default 0, so every key of a scene without .lag is the bits it was (start + 0, seconds / 1). What changes: examples/manual.zig, slide 1: 83, C0, 01 and add eax, 1 were written all at once over 1.5 s, now one after another (0.79 s each, 0.24 s apart); the six labels and three bytes of the flight played together, now in order, 0.12 s apart, 0.58 s each (exported frames 22.0- 23.4 s and 25.1-26.4 s). vecanim's intro passes .lag to a play of one write: unchanged. Tests: anim: a lagged play (four at 0.5, then two at 1) live against compiled at 16 instants, and its times. test-anim, test-talk, test-manual pass; the compiled scene's export (92 frames), the talk's two (364) and every scene screenshot are byte-identical to before, but for the player bar's wall-clock record time; manual's exports differ in those 29 frames only, its screenshots not at all. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* anim: part, the shapes of an object inside a rectangle as an object of their ownGabriel Schneider26 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s.part(of, .{ .x, .y, .w, .h }) takes the shapes of an object whose bounds' centre lies in the rectangle (x, y its centre, in the object's units: the same literal s.rect would lay over it standing at the origin at scale 1) and makes them an object, around the rectangle's centre, so indicate, scaleTo and rotate turn it about itself. The object draws the rest from then on (its new cut), so a part can be written in, moved away or morphed while the page around it stays. A part stands where its shapes stood and shows as the object does after the plays laid so far: taken from a page that has faded in, it is there; taken first, it fades in with nothing until played. A shape goes to the first part that takes it; parts of parts work the same way. transformInto morphs into the whole of its target, as if nothing were cut from it, so a morph's result can be split into parts taken after it (which then stand where they were and show as it does). How: Source.part holds the object as it was (a pointer: in a compiled scene to a comptime constant, in a live one into the frame's arena) and the area; Object.cut lists the areas taken from it; both are in the object's id. anim.sift makes either drawing out of the whole one, sharing its geometry; the Painter sifts its cached whole, so a page is parsed once however many parts it gives. In a compiled scene the part follows its object through the plays laid before it was taken (keys copied, moved by the area's centre at the object's scale and rotation); in a live one it starts from the object's shown and settled poses. build now also moves a shape's clip with its centring (it moved the shape and left the clip behind). Test, at the end of root.zig: a row of three squares, the right one taken once the row has faded in, then each moved: the compiled and the live scene agree at every instant, the part fades with the row, stands where its square stood, and the row keeps the other two. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* anim: the player's render path moves into anim.PainterGabriel Schneider26 hours
| | | | | | | | | | render, paint, reveal, built, stage, guides and labels move verbatim from player.zig into src/anim/Painter.zig, with the viewer's settings and the Typst module as parameters, so a sketch that runs a Deck itself paints its shot the same way: a Painter in its Session and paint() once a frame. The scene's frame size is anim.width/height and a Shot carries its t. Pixels unchanged: the scene tests' screenshots and all 92 exported frames match the previous build's.
* anim: talks: gates that let time run on, pause, beside, loop, clear, slides ↵Gabriel Schneider26 hours
| | | | | | | | | | | | | | | | | | | and the Deck A talk is a live scene re-run from the top every frame, a function of its time and of the gates opened so far. Frame.gate(open) waits while time runs on and records the value it opened with; pause() is the presenter's click. beside and loop are the sub-animations, slide() the second navigation level, clear() the end of a slide. anim.Deck is the playhead and the gate log as plain data for any sketch's State: update() takes an Ask (next, back, next_slide, back_slide, to, end) and runs the talk with the app mutable, shot() runs it read-only for drawing. A click during a step finishes it; back cuts to the picture held before the last click; an edit that moves the last opened gate moves t with it; exported, every gate holds Deck.hold. Live takes a namespace or a tuple of them (sources) and exposes frame. Builder.pause, Instant.clock and Frame.clock are gone: t runs through gates. A test-anim step runs the module's tests and the player's scenes.
* sketchbook: text in six faces of the Go family, all bundled (f.textIn, ↵Gabriel Schneider6 days
| | | | host.textSizeIn, sk.Face)
* sketchbook: anim, manim-style scenes as a module (from the game's vecanim), ↵Gabriel Schneider6 days
with objects a scene draws itself The player takes its canvas from the room it has and fits the scene's frame into it, plays through and quits when exported, and draws vector objects in runs around custom ones. The renderers' resvg comparison and the timings come along as `zig build diff` and `zig build bench`; the comparison's reference is padded to whole blocks rather than squeezed, which had put Typst text over the limit. Co-Authored-By: Claude Fable 5.2 <[email protected]>