cursor-rig
Cursor rig
A character who looks at you is the strongest hero a page can have. Building one in 3D means modelling, rigging and matching a painting's style, and the result never quite looks like the painting. This skill keeps the painting. It renders the head in every direction once, as a grid of poses, and at runtime shows the pose that faces the cursor. With 19 yaw steps and 8 pitch rows, the turn reads as continuous.
Tools
| File | What it does |
|---|---|
scripts/build_rig.py |
Turns head-turn clips into row_N.webp pose strips, plate.webp and rig.json |
assets/rig.js |
Loads the rig, places a canvas over the head, follows the pointer with a spring, blinks, glances about when idle |
Needs Python 3.9+, pip install numpy opencv-python-headless, ffmpeg, an image-editing model and an image-to-video model that accepts start and end frames (see motion-assets).
Pipeline
1. The plate
The plate is the character facing forward: the one image every pose is built on. Upscale the source illustration to at least 1440 px tall. If the hero needs to be wider than the character, outpaint the sides for the page, but build the rig on the square or portrait crop around the character. Outpainting models re-render the whole image, so paste the original pixels back over the middle afterwards.