Pre-rendered sprites
Watch the planted foot through the turn. In the sprite player, drop the sampling rate to four poses per second. Which part of the turn disappears?
Interactive demo#SpritesAndImages
Paint a rigged 3D character, shape its movement for one camera, and render the performance as 2D sprites.
Winter Fox follows a six-second dance from the capture rig to the sprite sheet. The face, ribbons and gold embroidery are painted on the model’s UV maps. Each arm and leg has a continuous surface, with the bend shared across the joint. In the arabesque, the far arm opens toward the camera to give the wrist a clear arc. The skirt lifts over the reaching thigh and the tail follows the turn. The supporting foot rises onto the flat platform of its satin shoe. Brush pressure varies slightly with each drawing. A fixed orthographic camera captures 16 poses per second on transparency. Keeping the same frame bounds preserves the dancer’s step across the stage. In the sprite player, change the sampling rate to see which poses carry the turn.
Code
namespace pre_rendered_sprites_lesson;
import stage;
import std;
import math;
export "pre-rendered-sprites" fn draw(time: f64, dt: f64, px: f64, py: f64, hover: bool) {
// Each row holds 12 of the 96 drawings in the six-second dance.
let fps = number_control("fps", 16);
let sample = ((time % 6.0) * fps) as i64;
let frame = (sample * 16.0 / fps) as i64;
rect(0, 0, W, H, "#f4e3c1");
rect(0, 77, W, 23, "#e9d5b0");
dancer_cell(frame % 12, frame / 12, 34, -6, 92);
let first = (frame / 8) * 8;
for i in 8 {
let pose = first + i;
let x = 12 + 17 * i;
rect(x, 81, 16, 17, "#fff1d3");
dancer_cell(pose % 12, pose / 12, x, 81, 16);
if pose == frame { rect(x, 97, 16, 2, "#ac3941"); }
}
}
Comments
No comments yet.