Skip to content

Film each scene with a camera that follows the narration - #32

Merged
vincentsch merged 1 commit into
mainfrom
camera
Oct 15, 2026
Merged

vincentsch merged 1 commit into
mainfrom
camera

Conversation

@vincentsch

Copy link
Copy Markdown
Owner

Until now each scene was one fixed frame, and a small diagram often sat in a corner of an empty frame. This adds a camera that films each scene, plus spring entrances and motion blur.

The camera. Before anything is drawn, explainroo measures each element of a scene: where it is, how big it is and when it is on screen. The camera opens on the picture and widens when something new would not fit. Something new that already fits needs no move, so a line added to a chart does not make the camera zoom. Now and then the camera moves in on what the voice talks about. It does that only when the viewer gets at least 1.5 seconds to look, and when the zoom last changed five or more seconds ago. Near the end of the scene it pulls back to show the whole picture.

While a shot holds, cards and labels are never cut in half. Each one is fully in the shot or out of it. Shots stay clear of the captions and of the buttons Shorts, TikTok and Reels put over the video. Highlighted code lines, terminal commands and the new s.focus() get close-ups when they are small in the shot. When a scene goes on with the picture of the scene before it, the camera stays where it was and the two scenes fade into each other. s.camera() still takes over a scene's camera, and "camera": "still" in video.json turns the camera off.

Motion. Entrances move on a spring and lift their shadow while they land. Final renders draw each moving frame six times over half a frame's time and average them, which gives motion blur. Drafts, GIFs and transparent videos skip it, and "motionBlur": false turns it off. Large headlines in the clean, midnight and editorial looks get slightly tighter letter spacing.

Cost. Final renders take about two to three times as long, and the MP4 files are about twice as big. Drafts are as fast as before.

Testing. npm test passes (216 tests). New tests check that a held shot never cuts a card, that something new that fits causes no move, that the camera does not keep zooming in and out, that the measured size of drawings matches what Chrome draws, and that motion blur keeps clip frames intact. I rendered the DNS, intro, leap years and callbacks examples with this branch and with 0.3.0 and compared them side by side. All four pass verify, with the narration understood 100%.

Before anything is drawn, explainroo now measures each element of a scene:
where it is, how big it is and when it is on screen. From that it plans a
camera for the scene. The camera opens on the picture and widens when
something new would not fit. Something new that already fits needs no move.
Now and then the camera moves in on what the voice talks about, and near the
end of the scene it pulls back to show the whole picture. While a shot holds,
cards and labels are never cut in half.

Shots stay clear of the captions and of the buttons Shorts, TikTok and Reels
put over the video. Highlighted code lines, terminal commands and the new
s.focus() get close-ups when they are small in the shot. A scene that goes
on with the picture of the scene before it keeps the camera where it was and
fades in. The background moves a third as much as the camera, so it looks
further away. s.camera() still takes over a scene's camera, and
"camera": "still" in video.json turns the camera off.

Entrances now move on a spring and lift their shadow while they land.

Final renders add motion blur to frames where something moves. Each such
frame is drawn six times over half a frame's time and averaged. Drafts, GIFs
and transparent videos skip it, and "motionBlur": false turns it off.

Large headlines in the clean, midnight and editorial looks get slightly
tighter letter spacing.

AGENTS.md and the README describe the camera.
@vincentsch
vincentsch merged commit 37b3dd1 into main Oct 15, 2026
4 checks passed
@vincentsch
vincentsch deleted the camera branch October 15, 2026 08:21
@vincentsch vincentsch mentioned this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant