The engine
Why we built Sifr
Sifr began with videos we love: the ones where an idea in mathematics is drawn while it is explained, until you can see why it is true. We wanted to make videos like that about anything, and we wanted everyone to be able to make them.
Where it began
Two things showed us what such a video can be. 3Blue1Brown, Grant Sanderson’s channel, where a formula grows out of a picture and every movement means something. And Manim, the animation library he wrote to make those videos, which a community has carried on and shared with everyone.
Much of how Sifr thinks comes from them: the picture before the words, formulas that turn into one another, a camera that moves through an idea, and one moment where it clicks.
What stood in the way
We tried to make our videos with it, and kept running into the same three walls.
Hard to set up
Before our first frame came the setup: Python and its packages, a LaTeX installation for the formulas, and system libraries that differed from one computer to the next. For most people who want to explain something, we thought, that is where it would end.
Slow to work with
Each scene we made had to be rendered to a video before we could watch it. A changed colour or timing meant rendering again and waiting, and the longer the scene, the longer the wait. Our work moved in slow loops.
Code, not a picture
Each scene was a program. Changing it meant reading and writing code, and when we asked an AI to change one, it wrote code without seeing what it drew.
So we made Sifr
A new engine, written from scratch in Rust, made for the browser and for AI from its first line. This is a whole scene, and beside it the engine playing it, live, in this page.
{
"schema": 1,
"fps": 60,
"params": [{ "id": "a", "value": -1.5 }],
"nodes": [
{ "id": "ax", "type": "axes", "props": { "pos": [-1.8, -0.4], "size": [9, 7], "xRange": [-2.5, 2.5], "yRange": [-1, 6.5] } },
{ "id": "f", "type": "plot", "props": { "axes": "ax", "fn": { "expr": "x^2" }, "color": "#ece6d9" } },
{ "id": "t", "type": "tangent", "props": { "plot": "f", "x": { "expr": "a" }, "length": 3.6, "color": "#e2ae4a" } },
{ "id": "p", "type": "dot", "props": { "axes": "ax", "pos": { "expr": "[a, a^2]" }, "color": "#e2ae4a" } },
{ "id": "m", "type": "readout", "props": { "value": { "expr": "2 * a" }, "prefix": "f'(a) = ", "decimals": 1, "pos": [5.2, 1.5] } }
],
"beats": [
{ "id": "draw", "frames": 50, "clips": [
{ "id": "c1", "type": "create", "node": "ax" },
{ "id": "c2", "type": "create", "node": "f" } ] },
{ "id": "touch", "frames": 40, "clips": [
{ "id": "c3", "type": "create", "node": "t" },
{ "id": "c4", "type": "create", "node": "p" },
{ "id": "c5", "type": "create", "node": "m" } ] },
{ "id": "slide", "frames": 150, "clips": [{ "id": "c6", "type": "tween", "target": "a", "to": 1.5 }] },
{ "id": "back", "frames": 150, "clips": [{ "id": "c7", "type": "tween", "target": "a", "to": -1.5 }] }
]
}
-
Nothing to install
The engine runs in your browser as WebAssembly. It sets formulas itself, in the Latin Modern faces TeX uses, so there is no LaTeX to install. The studio is a web page.
-
Every frame at once
A frame is worked out from the scene and its number alone, so any moment shows the instant you ask: drag the playhead, change a value, and see it. The video itself is made in your browser too, where it can be.
-
One document
A scene is one JSON document: its things, its values and its steps. You change it in the editor, an AI changes it with checked edits, and every change can be undone.
-
Made for AI
Every problem comes with a code and a hint. The AI looks at frames and storyboards of what it made, and a layout check finds overlapping and cut-off text before you do.
-
One picture everywhere
The preview, the exported video and the frames the AI looks at are drawn from the same list of shapes, so they always match.
What it draws
- Graphs, plots and number lines
- Formulas that turn into one another
- Tangents, areas and Riemann sums
- 3D surfaces, curves and solids
- Vector fields and flowing stream lines
- Differential equations, solved as they draw
- Networks, trees and Venn diagrams
- Tables, bar charts and code
- Narration, with captions in step
Sifr is an engine of its own, and is not affiliated with Manim, 3Blue1Brown or Grant Sanderson. We are grateful for what they showed is possible.