ApasScript.

Animation

These are Apas Cloud services: they run on our servers for a signed-in member. The examples below are shown already made; sign in to edit and run your own.

animate Apas Cloud

An animation: calls f(t) for n values of t from tmin to tmax, each call drawing one frame with draw()/text()/... (only the finished animation shows, not each frame). Set the view first with xrange()/yrange() -- inside quiet { } so they show nothing themselves -- so it stays still. An optional fifth argument sets the speed in frames per second, 0.1 to 60: animate(0, 5, 6, step, 1) holds each of six pictures for a second. f is a function written with fn: by name, or in place as fn(t) draw(...) when one call draws the frame.

sketch Apas Cloud

Frame-by-frame animation with memory, like Processing: setup() runs once -- what it draws is the background of every frame, and what it returns is the starting state -- then draw(i, state) draws frame i (0 to n-1) and returns the next state. sketch(n, draw) with draw(i) alone works too. An optional last argument sets the speed in frames per second (0.1-60). setup and draw are functions written with fn, by name or in place (fn(i, p) { ... }).