summaryrefslogtreecommitdiff
path: root/examples/vecanim/scenes/live.zig
diff options
context:
space:
mode:
Diffstat (limited to 'examples/vecanim/scenes/live.zig')
-rw-r--r--examples/vecanim/scenes/live.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/vecanim/scenes/live.zig b/examples/vecanim/scenes/live.zig
index cefdbc5..9b94d17 100644
--- a/examples/vecanim/scenes/live.zig
+++ b/examples/vecanim/scenes/live.zig
@@ -1,6 +1,7 @@
//! A live scene, presented like slides: `frame` runs every frame, so the
-//! code after the plays can follow the mouse, the clock or any data, and
-//! `pause` holds until a click. Everything it needs is in this file.
+//! code after the plays can follow the mouse, the time or any data, and
+//! what comes after a `pause` waits for a click while time runs on.
+//! Everything it needs is in this file.
const anim = @import("anim");
pub const typst_preamble =
@@ -28,7 +29,7 @@ fn frame(s: *anim.Frame) void {
s.play(.{ title.fadeOut(), hint.fadeOut() }, .{ .seconds = 0.6 });
// A wave of dots: its height is a value the timeline animates, its
- // phase the wall clock, which runs on through pauses.
+ // phase the scene's time, which runs on while a pause waits.
const wave = s.typst(typst.wave, .{ .y = -220, .scale = 1.2 });
const note = s.typst(typst.note, .{ .y = 230 });
const height = s.value(0);
@@ -61,7 +62,7 @@ fn frame(s: *anim.Frame) void {
for (dots) |d| {
const p = s.pose(d);
const envelope = 1 - s.get(damping) * (1 - @exp(-p.x * p.x / 1e5));
- p.y = s.get(height) * envelope * @sin(p.x / 90 - s.clock * 2);
+ p.y = s.get(height) * envelope * @sin(p.x / 90 - s.t * 2);
const near = @max(0, 1 - @abs(p.x - s.pointer[0]) / 120);
p.scale = 1 + near;
p.y -= 40 * near;