On this page:
Animate
9.3

Animate🔗ℹ

 (require animate) package: animate

Animate is a Racket library for making animations and videos. You describe the objects, give them names, and say how they change over time. The same animation can produce a still picture, a preview, or a video.

This manual describes version 1.23.0 of the checked-out source, at implementation stage SCENE-3D-V. Examples use ordinary Racket. You do not need a special language.

Choose a starting point

Part

  

Use it to

Concepts

  

Understand scenes, time, layouts, and identity.

Cookbook

  

Find a short solution to a particular task.

Guide

  

Make an animation from start to finish.

Complete Example Programs

  

Study whole programs and frames from their animations.

Reference

  

Look up names, arguments, results, and limits.

New to Animate? Start with Quick Start: a moving circle. It makes one moving circle. Continue through the Guide to save a movie, add slides, and use richer content. The slide route starts at Make a slide and give it time; its only Animate prerequisites are the Scene and Pict introduced in the Quick Start.

The Cookbook is for returning to a particular task. Complete Example Programs shows whole source programs beside their results. The Reference keeps complete contracts separate from the learning path.

Beyond the first circle, Build a small scene teaches groups, timing, and graphs. Use Find a task or a name to find a task or API name, and Similar words, different values to distinguish similar terms.

    I Concepts

      1 Objects, scenes, and output

        1.1 A few useful words

        1.2 Two ways to arrange a video

        1.3 Preparation does the work that must happen first

        1.4 Where to put your code

      2 Scenes and time

        2.1 A frame does not depend on the previous frame

        2.2 Durations and frame numbers are different

        2.3 Several clocks may be involved

      3 Position, size, and pixels

        3.1 Ordinary two-dimensional Scenes

        3.2 Slides and named parts

        3.3 Changing resolution is not changing format

        3.4 Fit has three common meanings

      4 Slides, builds, and continuity

        4.1 Hidden is not absent

        4.2 Builds happen within a clip

        4.3 Transitions happen between clips

        4.4 A role is not an identity

        4.5 What semantic matching can and cannot do

        4.6 Preparation and rendering are still separate

      5 Colors and Themes

        5.1 Categories and scales

        5.2 Inspecting a result

      6 Text roles, fonts, and size

        6.1 Roles and raw text

        6.2 World units become output pixels

        6.3 Typography and color are separate choices

        6.4 Backgrounds and borders

        6.5 Inspect the result

      7 Formula parts and source maps

      8 Objects that depend on other objects

      9 Three-dimensional coordinates

        9.1 The axes

        9.2 Scale, rotate, then move

        9.3 Geometry and drawing are separate

      10 Similar words, different values

        10.1 An object, a moment, and an animation

        10.2 A variable, an ID, and a path

        10.3 A group and a layout

        10.4 Duration, start time, and local time

        10.5 2D geometry, a construction, and 3D content

        10.6 Preparation, rendering, and encoding

    II Cookbook

      11 Common Scene tasks

        11.1 Move one part of a diagram

        11.2 Start the second animation later

        11.3 Bring a faded object back

        11.4 Reveal a mathematical graph

        11.5 Inspect a frame without making a movie

      12 Draw plots while moving the camera

        12.1 Build the plotted Visuals

        12.2 Animate the plots and camera together

        12.3 Render explicitly

      13 Themed Mathematics

      14 Slide recipes

        14.1 Make a title card

        14.2 Reveal one bullet at a time

        14.3 Use your own theme

        14.4 Keep a title between slides

        14.5 Move children as their panel changes layout

        14.6 Move an equation while doing its algebra

        14.7 Reuse an animated construction

      15 Choose a slide transition

        15.1 Blend the pictures: crossfade

        15.2 Move both pictures: push

        15.3 Move only a boundary: wipe

        15.4 Move only one picture: cover and uncover

        15.5 Change size: zoom

        15.6 Pass through a color: fade-through

        15.7 Retain an idea: match

        15.8 Limit motion without changing the timing

      16 Combining Appearance and Text Effects

        16.1 Composing Exact Enter/Leave and Text Effects

        16.2 Stroke-Width Animation

        16.3 Fill and Stroke Color Animation

        16.4 Unified Style Transitions

      17 Camera Views and Fixed Overlays

        17.1 Animated Camera Views

        17.2 Automatic Camera Framing and Following

          17.2.1 Fitting a Rendered Box

          17.2.2 Fitting Visuals and Scene Targets

          17.2.3 Following a Moving Visual

        17.3 Fixed-in-Frame Overlays and Callouts

      18 Combining and Timing Animations

        18.1 Local Visual Animation Timing

        18.2 Successive Visual Animation Composition

        18.3 Parallel Visual Animation Composition

        18.4 Lagged Visual Animation Composition

        18.5 Duration-Scaled Visual Animation Composition

      19 Following Paths, Tangents, and Offsets

        19.1 Arc-Length Path Following

        19.2 Path Tangents, Orientation, and Normal Offsets

        19.3 Continuous Joined Offset Paths

        19.4 Path Reversal and Cyclic Starts

      20 Matching Path Outlines

        20.1 Automatic Closed-Loop Morph Correspondence

        20.2 Automatic Open-Path Morph Correspondence

        20.3 Automatic Compound-Path Morph Correspondence

        20.4 Automatic Open-Compound Morph Correspondence

        20.5 Automatic Mixed-Topology Compound Morph Correspondence

      21 Growing and Removing Subpaths

        21.1 Topology-Changing Morphs and Subpath Birth/Death

        21.2 Explicit Birth/Death Anchors

        21.3 Per-Subpath Birth/Death Anchors

        21.4 Penalized Topology-Changing Correspondence

        21.5 Per-Subpath Birth/Death Penalties

        21.6 Per-Pair Real-Match Penalties

      22 Combining Plot Areas and Observations

      23 3D objects and cameras

        23.1 Move the object, not its window

        23.2 Keep the object still and change the view

        23.3 Use the complete three-file lesson

        23.4 Use the ordinary software renderer

      24 Render and review recipes

        24.1 Render a slide video with ten workers

        24.2 Render a dark gallery

        24.3 Render only the examples you need

        24.4 Compare Pict and Scene output and keep the logs

        24.5 Inspect a slide in storyboard context

    III Guide

      25 Quick Start: a moving circle

        25.1 Describe one object

        25.2 Put it in a Scene

        25.3 See the Scene

        25.4 Give it a movement

        25.5 Keep the result visible

      26 Save frames and make a video

        26.1 Render the frames

        26.2 Encode an MP4

        26.3 Keep file-writing commands separate

      27 Build a small scene

        27.1 Give each object a name

        27.2 Move just one object

        27.3 Move several objects together

        27.4 Move one child inside a group

        27.5 Try one change

      28 Control time and visibility

        28.1 Start two movements together

        28.2 Run one movement after another

        28.3 Delay the second start

        28.4 Change the speed, not the schedule

        28.5 Introduce an object

        28.6 Hide an object, or remove it

        28.7 Keep a last picture on screen

      29 Draw a graph

        29.1 Choose the numbers and the drawing size

        29.2 Turn a function into a curve

        29.3 Draw the curve over time

        29.4 Keep the graph with its axes

        29.5 Choose the next step

      30 Make a slide and give it time

        30.1 Write a title card

        30.2 Make a clip

        30.3 Reveal the title, then the subtitle

        30.4 Give individual bullets names

        30.5 Actions within a beat

      31 Put slides together

        31.1 Start a short lesson

        31.2 Join the three clips

        31.3 Check the arithmetic of time

        31.4 Look closely at a matching title

        31.5 Choose another transition

      32 Change appearance and format

        32.1 Format is not resolution

        32.2 Choose a text style only when needed

      33 Pace a lesson with narration

        33.1 Replace the draft with a recording

        33.2 Subtitles and timeline output

      34 Put an animation inside a slide

        34.1 Choose the figure’s visible area

        34.2 Embed the Scene

        34.3 Start its own clock

        34.4 Prepare resource-dependent content

        34.5 A mathematical explanation has its own plan

        34.6 Reuse a geometry construction

      35 Make a first 3D picture

        35.1 Make an object

        35.2 Choose where to look from

        35.3 Put the object inside a view

        35.4 Use an ordinary Scene

        35.5 Ask for a picture

      36 Animate a 3D object and its camera

        36.1 Turn the object inside the view

        36.2 Move the camera around the object

        36.3 Move the whole window

        36.4 Build a complete six-second sequence

      37 Combine 3D with text and slides

        37.1 Choose what a label follows

        37.2 Put the animation in a slide

        37.3 Choose the next topic when you need it

      38 Keep parts connected across slides

        38.1 Name the parts you want to follow

        38.2 Freeze a point in an existing animation

        38.3 Replay the known interval while changing the layout

        38.4 The same idea works for a construction

        38.5 Let two domains advance in one bridge

        38.6 Choose the strictness and inspect the result

      39 Organize a source program

        39.1 A reusable source file

        39.2 Add blocks when you need frequent edits

      40 Preview, edit, and inspect

        40.1 Open the source program you just learned

        40.2 Review a short interval

        40.3 Inspect an object

      41 Render a larger project

        41.1 Declare a project when you need more control

        41.2 Inspect the plan before writing files

        41.3 Math and geometry use the same worker pool

        41.4 Finish with two kinds of review

      42 Find the cause of a wrong result

        42.1 Run three fast semantic checks

        42.2 The program finishes without showing anything

        42.3 The finished object never appears in the movie

        42.4 An object is missing, or its ID is already present

        42.5 The wrong thing moves

        42.6 Two changes happen together when they should not

        42.7 The embedded figure is visible but frozen

        42.8 The runner refuses the output directory

        42.9 A build or review reports errors

    IV Complete Example Programs

      43 A moving circle

        43.1 Complete source

        43.2 How the program is organized

        43.3 Render the movie

        43.4 Try one change

      44 Draw and move a function graph

        44.1 Complete source

        44.2 How the program is organized

        44.3 Render either animation

        44.4 Try one change

      45 A complete slide lesson

        45.1 Complete lesson source

        45.2 How the program is organized

        45.3 Render the lesson

        45.4 Keep render settings in a project file

        45.5 Try one change

      46 Algebra across layouts

        46.1 Complete source

        46.2 How the program is organized

        46.3 Render the movie

        46.4 Try one change

      47 A geometry construction lesson

        47.1 Complete source

        47.2 How the program is organized

        47.3 Render the movie

        47.4 Try one change

      48 Semantic matching of named parts

        48.1 Complete source

        48.2 How the program is organized

        48.3 Render the movie

        48.4 Try one change

      49 A 3D lesson in three files

        49.1 First file: the object and view

        49.2 Second file: motion and timing

        49.3 Third file: labels and the slide version

        49.4 Render a version

        49.5 Try one change

      50 A source-block program

        50.1 Complete source

        50.2 How the program is organized

        50.3 Render the compiled Scene

        50.4 Open the maintained interactive variant

        50.5 Try one change

      51 More example programs

        51.1 Animation and composition

        51.2 Plots, relations, and trajectories

        51.3 Formula animation

        51.4 Authoring, text, and media

        51.5 3D examples

    V Reference

      52 Find a task or a name

        52.1 Ordinary Scenes

        52.2 Graphs and mathematical content

        52.3 Slides and continuity

      53 Modules to require

      54 Scenes and sampling

      55 Scene states

      56 Animation requests

        56.1 Moving, rotating, and scaling

          56.1.1 Robust Pointwise Maps

        56.2 Changing color, width, and opacity

        56.3 Adding, revealing, and removing objects

        56.4 Drawing attention

        56.5 Drawing and morphing paths

        56.6 Matching compound path outlines

        56.7 Replacing and matching shapes

        56.8 Writing and transforming text and formulas

          56.8.1 Serializable Rate Functions

        56.9 Changing named values

        56.10 Moving the camera

        56.11 Combining and timing requests

        56.12 Choosing a speed curve

        56.13 Other animation requests

      57 Native model details

        57.1 World Coordinates

        57.2 Visuals and Identity

        57.3 Text and Formulas

        57.4 Paths

        57.5 Arrows and Cartesian Axes

        57.6 Sampled Function Graphs

        57.7 Parametric Curves and Data Plots

        57.8 Point Markers, Scatter Plots, and Filled Areas

        57.9 Scene States and Scenes

        57.10 Transforms

        57.11 Groups

        57.12 Relative Layout

        57.13 Opacity

        57.14 Time and Frames

      58 Visuals

        58.1 Visual Protocols and Groups

          58.1.1 The Basic Visual Protocol

          58.1.2 Whole-Visual Affine Maps

          58.1.3 The Affine-Visual Protocol

          58.1.4 The Opacity-Visual Protocol

          58.1.5 The Stroke-Width-Visual Protocol

          58.1.6 Fill-Color and Stroke-Color Visual Protocols

          58.1.7 Group Visuals

        58.2 Shapes and Path Visuals

          58.2.1 Circle Visuals

          58.2.2 Rectangle Visuals

          58.2.3 Path Visuals

          58.2.4 Mathematical Shape Catalogue

        58.3 Bitmap and SVG Visuals

          58.3.1 Bitmap Images

          58.3.2 Full-Fidelity SVG Images

          58.3.3 Semantic SVG Import

        58.4 Text Content and Layout

          58.4.1 Plain, Multiline, and Rich Text Visuals

            58.4.1.1 Constructing Text Visuals

            58.4.1.2 Inspecting and Updating Text

        58.5 Semantic Text and Typography Styles

          58.5.1 Semantic Text and Typography

            58.5.1.1 Backgrounds, Borders, and Padding

            58.5.1.2 Complete Styles

            58.5.1.3 Typography Snapshots

            58.5.1.4 Role-Based Text

        58.6 Numbers and Units

          58.6.1 Numeric Displays

            58.6.1.1 Formatting Strings and Units

            58.6.1.2 Static Numeric Visuals

            58.6.1.3 Parameter-Driven Displays

        58.7 Matrices, Tables, and Vector Diagrams

          58.7.1 Matrices and Tables

          58.7.2 Linear-Algebra Diagrams

        58.8 Formula Construction and Layout

          58.8.1 LaTeX Formula Visuals

            58.8.1.1 Inspecting and Updating Formula Models

          58.8.2 Tagged Formula Layouts

          58.8.3 Making latex-pict Available

        58.9 Formula Assemblies and Named Parts

          58.9.1 Named Formula Parts and Correspondence

        58.10 Formula Source Selection and Matching

          58.10.1 Source-Addressable Formulas

            58.10.1.1 Querying Retained Source

            58.10.1.2 Planning String Correspondences

            58.10.1.3 Part Routes and Copies

            58.10.1.4 Generated SVG Fragments

            58.10.1.5 Part and Glyph Transitions

            58.10.1.6 Anchored Rewrites

            58.10.1.7 Derivation Steps

        58.11 Arrows and Coordinate Axes

          58.11.1 Arrow and Cartesian Axes Visuals

            58.11.1.1 Arrows

            58.11.1.2 Axis Ranges

            58.11.1.3 Cartesian Axes

        58.12 Live Endpoints and Mathematical Annotations

          58.12.1 Dynamic Endpoint Geometry

          58.12.2 Mathematical Annotations

        58.13 Complex and Polar Visuals

          58.13.1 Complex and Polar Coordinates

        58.14 Function, Parametric, and Data Plots

          58.14.1 Coordinate Curves and Plots

            58.14.1.1 Interpolation Modes

            58.14.1.2 Sampled Curves and Fields

          58.14.2 Function Graphs

            58.14.2.1 Adaptive Sampling

            58.14.2.2 Derived Function Graphs

          58.14.3 Parametric Curves

          58.14.4 Ordered Data Plots

        58.15 Graph Helpers and Traced Paths

          58.15.1 Coordinate and Calculus Helpers

          58.15.2 Deterministic Traced Paths

        58.16 ODE Trajectories and Streamlines

          58.16.1 Deterministic ODE Flow and Streamlines

            58.16.1.1 Solver State Spaces

            58.16.1.2 Direct Fixed-Step Integration

            58.16.1.3 Adaptive Configuration and Events

            58.16.1.4 Prepared Trajectories

            58.16.1.5 Streamlines and Flow Particles

        58.17 Relations and Live Layout

          58.17.1 First-Class Relation Visuals

            58.17.1.1 Acyclic Live Layout

      59 Geometry

        59.1 Scene Parameters

        59.2 Path Geometry

          59.2.1 General Boolean Path Geometry and Clipping

        59.3 Affine Transforms

          59.3.1 General Affine Maps

        59.4 Cameras

        59.5 Frame-Space Overlays and Callouts

        59.6 Semantic Colors and Paints

          59.6.1 Semantic fill paints

      60 Number Lines and Coordinate Decorations

      61 Point Markers, Scatter Plots, and Filled Areas

      62 Probability and Statistical Diagrams

      63 Calculus lessons

        63.1 Caption text

        63.2 Policies and headless inspection

        63.3 Release review

      64 Colors

        64.1 Color Scales

        64.2 Palettes and Themes

        64.3 Inspection and Diagnostics

        64.4 Palette Tokens

        64.5 Semantic Role Tokens

        64.6 Fixed Literal Endpoints

      65 Slides

        65.1 Slide descriptions and content

        65.2 Inline TeX text content

          65.2.1 Pict and image content

        65.3 Themes and formats

        65.4 Layouts and regions

        65.5 Clips, beats, and narration

        65.6 Slot actions

        65.7 Storyboards and transitions

        65.8 Named children and frozen checkpoints

        65.9 Pict and Scene conversion

          65.9.1 Pict output

          65.9.2 Scene and timeline output

        65.10 Native, mathematical, and geometry content

          65.10.1 Native Scene content

          65.10.2 Mathematical content

          65.10.3 Geometry content

        65.11 Preparation and inspection

          65.11.1 Preparation

          65.11.2 Inspection helpers

        65.12 Project sources

        65.13 Gallery catalogue

        65.14 Core predicates and read-only accessors

      66 Slide command-line tools

        66.1 Gallery runner

        66.2 Visual probe runner

        66.3 Files and transcript scope

        66.4 Manifest fields

        66.5 Test runner

      67 Source Programs and Authored Timelines

        67.1 Named source blocks

      68 Interactive Preview and Inspection

      69 Preview controls and diagnostics

      70 Projects and Final Rendering

      71 Project execution and cache details

      72 Pict Renderer Protocol

        72.1 Built-in Rendering

        72.2 Defining a Custom Renderer

        72.3 Relative Layout

          72.3.1 Fitting a Background

        72.4 Temporary Attention Effects

        72.5 Pict, Bitmap, and Frame Conversion

        72.6 PNG and MP4 Output

          72.6.1 Authored timelines and selected sections

            72.6.1.1 Rendering selected frames and authored sections

          72.6.2 Mathematical graphs and networks

          72.6.3 MP4 encoding and media assembly

          72.6.4 Project execution

        72.7 Errors and Validation

        72.8 Determinism and Immutability

      73 3D reference map

      74 3D: Objects, groups, and paths

      75 3D: Cameras and projection

      76 3D: Views inside a Scene

      77 3D: Animating 3D objects

      78 3D: Animating the 3D camera

      79 3D: Cuts, caps, and section measurements

      80 3D: Supplementary surface, section, and annotation bindings

      81 3D: Cuts, sections, and numerical volume

      82 3D: Vectors

      83 3D: Linear maps and rotations

      84 3D: Affine transforms

      85 3D: Bounds, rays, and planes

      86 3D: Spatial maps and homotopies

      87 3D: Materials and lights

      88 3D: Lighting inspection

      89 3D: Shadow descriptors and stable bounds

      90 3D: Finite-light animation

      91 3D: Software finite-light evaluation

      92 3D: Colour space and final output

      93 3D: Relations and geometric annotations

      94 3D: Projected labels

      95 3D: Textured billboards

      96 3D: Spatial curves and vector diagrams

      97 3D: Spatial anchors and label layout

      98 3D: Anchors and projected labels

      99 3D: Parametric surfaces and calculus

      100 3D: Adaptive, trimmed, and implicit surfaces

      101 3D: Constructive solids

      102 3D: Surface constructors and queries

      103 3D: Meshes

      104 3D: Triangle topology

      105 3D: Polygonal faces

      106 3D: Deterministic convex hulls

      107 3D: Polyhedral duals

      108 3D: Schlegel diagrams and polyhedral nets

      109 3D: Conservative mesh correspondence

      110 3D: Topology-safe mesh matching

      111 3D: Checking and repairing mesh orientation

      112 3D: Clipping, sections, and transparency

      113 3D: Prepared spatial ODE trajectories and vector fields

      114 3D: Seeds and streamline sets

      115 3D: Poincare sections and return maps

      116 3D: Equilibria and local linearization

      117 3D: Flow maps and volume change

      118 3D: Drawing and inspecting trajectories

      119 3D: Reading prepared trajectories

      120 3D: Drawing vector fields and particles

      121 3D: Trajectory display

      122 3D: Spatial inspection and exact picking

      123 3D: Retained renderer backends

      124 3D: Compiled geometry and instances

      125 3D: Frame requests and results

      126 3D: Software rendering and statistics

      127 3D: Optional Racket/OpenGL backend

      128 Experimental Derived Visuals

      129 Source Package Hygiene