Tessarune
Technique Note 11 · 3D Pixel-Art Turnaround

One 3D Model, Full 64×64 Pixel Turnaround

Published:

Flipping a 90° sprite fails asymmetric characters and fixed top-left lighting at the same time. Using the Tessarune 1.5.0 sample fledgling-angel.ts (Fledgling Fallen Angel), this note measures how one 3D solid.model() renders four cardinal idles and a continuous 0°↔180° turnaround—360 frames at 64×64 and 12 fps—with 0 off-palette colors, 0 partial-alpha pixels, and ±28° eye culling that prevents far-eye detachment.

Watch the 15-second visual breakdown of the ±28° eye culling and mirror comparison in the companion YouTube Short.

Watch the 15s YouTube Short →

Why Mirroring Breaks Asymmetry and Flat Eyes Peel Off at Oblique Angles

Horizontal mirroring (mirror(right)) is a common shortcut for generating a left-facing sprite from a right-facing one, but it breaks two invariants at once on an asymmetric character. In fledgling-angel.ts, the Fledgling Fallen Angel has a white left wing (droop = 0), an ink-stained black right wing (droop = 3), an asymmetric ahoge, and a chipped halo. Mirroring the 90° view swaps the wings front-to-back, flips the chipped halo and ahoge, and reverses the fixed top-left light source onto the opposite side.

Building a single 3D solid.model() solves the silhouette and lighting consistency across all azimuths, yet rotating a 3D head into pixel art introduces a second geometric trap. If both 4×5 eyes are placed on a single flat front plane (angle: 0) without backface culling, the far eye remains visible past the profile edge and peels off outside the head outline at oblique angles.

The solution is to treat each eye as a curved cranial surface: tilt the left and right eye groups outward by ±28° around Y, then skip drawing an eye whenever Math.cos((az + s * 28) * Math.PI / 180) < 0.34 (roughly 70.1° away from the camera). Combined with solid.paint depth-step outlining and g.detached(...) layers for the shadow and halo, every angle stays crisp at 64×64.

Pixel-by-Pixel Measurements Across All 360 Frames

Comparing mirror(angel_idle-right) against the true 3D angel_idle-left (azimuth 270°) shows 900 differing pixels out of a 1,211 px union on frame 0 (74.3%): 156 px from silhouette mismatches (the drooping black wing, ahoge, and chipped halo) and 744 px from interior color and lighting mismatches. Across all 72 frames, 63,865 of 86,813 union pixels differ (73.6%). On frame 0, the true 270° view puts 113 px of the black wing (wb0/wb1/wb2) in the foreground, whereas mirror(right) pushes the white wing forward and leaves only 10 px of the black wing visible in the back.

Comparing flat unculled eyes (angle: 0, no cos < 0.34 check) against the ±28° curved placement with ~70° culling across all 72 frames of angel_turn reveals errors in 37 of 72 frames (51.4%), totaling 766 erroneous pixels—25 px of which protrude completely outside the head silhouette. At representative frame f23 (azimuth 62.9°), the unculled flat eyes produce a 28 px error: 5 px jutting outside the face outline and 23 px bleeding into the cheek and hair. With ±28° tilt and the 0.34 cosine threshold, protrusion drops to 0 px.

Across all 5 exported variants (angel_idle-front 0°, angel_idle-right 90°, angel_idle-back 180°, angel_idle-left 270°, and angel_turn 0°↔180° at 12 fps × 6 s = 72 frames each, 360 frames total), the pal definition holds 23 entries (22 unique hexes, since rb2 and eyW share #ffffff), and 21 unique RGBs are actually drawn (front: 21, right: 20, back: 16, left: 20, turn: 21). Off-palette colors measure 0 and partial-alpha pixels measure 0 (alpha values are strictly {0, 255}). Frame 0 opaque pixel counts are 1,356 px (front), 1,119 px (right), 1,371 px (back), 1,147 px (left), and 1,356 px (turn f0).

Mirror(idle-right) vs. Real 3D idle-left (64×64, f0 — 74.3% pixels differ)

mirror(angel_idle-right) f0: 74.3% pixel mismatch; white wing pushed to front, black wing reduced to 10 px, top-left lighting inverted.
Mirrored right (BAD)
mirror(angel_idle-right) f0: 74.3% pixel mismatch; white wing pushed to front, black wing reduced to 10 px, top-left lighting inverted.
True 3D angel_idle-left (270°) f0: ink-stained black wing in foreground (113 px) with consistent top-left lighting.
3D left 270° (GOOD)
True 3D angel_idle-left (270°) f0: ink-stained black wing in foreground (113 px) with consistent top-left lighting.
Difference mask f0 (900 / 1,211 px): coral = 156 px silhouette mismatch, gold = 744 px interior color and lighting mismatch.
900 / 1,211 px (74.3%)
Difference mask f0 (900 / 1,211 px): coral = 156 px silhouette mismatch, gold = 744 px interior color and lighting mismatch.

All 4 animated facings from one 3D solid.model() (64×64, 72f @ 12 fps each)

angel_idle-front (0°, 1,356 px, 21 RGBs)
Front 0° (21 RGB)
angel_idle-front (0°, 1,356 px, 21 RGBs)
angel_idle-right (90°, 1,119 px, 20 RGBs)
Right 90° (20 RGB)
angel_idle-right (90°, 1,119 px, 20 RGBs)
angel_idle-back (180°, 1,371 px, 16 RGBs)
Back 180° (16 RGB)
angel_idle-back (180°, 1,371 px, 16 RGBs)
angel_idle-left (270°, 1,147 px, 20 RGBs)
Left 270° (20 RGB)
angel_idle-left (270°, 1,147 px, 20 RGBs)
8× head zoom at f23 (62.9°): left = flat unculled eyes with 5 px (gold box) protruding outside the outline; center = ±28° tilt + 70° culling with 0 protrusion; right = 28 px error mask (coral 5 px outside, gold 23 px inside).
8× head zoom at f23 (62.9°): left = flat unculled eyes with 5 px (gold box) protruding outside the outline; center = ±28° tilt + 70° culling with 0 protrusion; right = 28 px error mask (coral 5 px outside, gold 23 px inside).
Top: 6 keyframes of angel_turn 0°→180° (f00, f21, f23, f25, f28, f36) with continuous flap and bob. Bottom: comparison bars for mirror error (74.3% / 73.6%), flat-eye error (37/72 frames), and shipped discipline (0 off-palette, 0 partial alpha).
Top: 6 keyframes of angel_turn 0°→180° (f00, f21, f23, f25, f28, f36) with continuous flap and bob. Bottom: comparison bars for mirror error (74.3% / 73.6%), flat-eye error (37/72 frames), and shipped discipline (0 off-palette, 0 partial alpha).

Fledgling Fallen Angel — measured variants (360f @ 12 fps) & naive baselines

Variant / comparisonAzimuthFramesOpaque px (f0)Drawn RGBsKey measurement
angel_idle-front0°721,356 px210 off-palette · 0 partial alpha
angel_idle-right90°721,119 px20white wing in front (droop = 0)
angel_idle-back180°721,371 px16both eyes culled · notched halo
angel_idle-left270°721,147 px20113 dark-wing px in front (droop = 3)
angel_turn0° <-> 180°721,356 px21smoothstep sweep + continuous idle(t)
mirror(right) vs 3D left270°721,211 union20900/1,211 f0 (74.3%: 156 sil + 744 col); 63,865/86,813 / 72f (73.6%); 10 vs 113 dark-wing px
flat eyes vs ±28° + 70° cull0° <-> 180°72—21766 px err across 37/72f (25 px outside; f23 62.9°: 28 err / 5 px outside -> 0)
All 5 shipped variantsfull 4-way + turn36064×6421 / 22 hex23 pal entries · 0 off-palette · alphas {0, 255}

Full 360-frame measurement via Tessarune CLI 1× render: 23 palette entries (22 unique hexes), 21 drawn RGBs, 0 off-palette colors, 0 partial-alpha pixels.

Inside fledgling-angel.ts: Wings, Cranial Eyes, and Depth Outlines

Lines 103–104 instantiate the asymmetric wings via wing(m, -1, "white", "wingWhite", p.flap, 0) and wing(m, 1, "black", "wingBlack", p.flap, 3) (with wing() defined at L44–56). At L126–136, each 4×5 eye (EYE, L, R with blink states) is wrapped in m.group({ pivot: [s * 3.5, 40, 7.8], axis: "y", angle: s * 28 }, ...) so it sits on the curved skull, while L132 skips rendering when Math.cos((az + s * 28) * Math.PI / 180) < 0.34.

Lines 145–154 define halo(t) as a standalone model using solid.sdf.subtract to carve a chipped torus that flickers independently of the body. Lines 157–163 define turnAzimuth(t) using smooth = (x) => x * x * (3 - 2 * x) to ease smoothly between 0° and 180° with brief holds at front and back, while idle(t) (L61–74) keeps running—driving 0–2 px integer bobbing, ±22° wing flaps, ±8° head tilt, ±4° nod, delayed hair/hem sway, and three blinks.

Lines 165–182 wire the shared camera view = { materials: MATS, azimuth: az, elevation: 14, at: [32, 61] } into solid.paint(g, angel(t, az), { ...view, smooth: 2, outline: { key: "ink", inner: 2.5 } }) (L171), drawing a 1 px #2e1d2e outline around the outer silhouette and any interior depth step ≥ 2.5. The ground shadow (L170) and chipped halo (L172) are placed in g.detached(...) so they do not merge into the body outline, and submit(Angel, ...) (L175–182) exports all 5 variants in one pass.

L103–104 & L126–136: Asymmetric wing(m, -1/1, ..., droop 0/3) and ±28° curved eye groups with L132 cos < 0.34 (~70.1°) culling prevent far-eye peeling.

fledgling-angel.ts · 103–104, 126–136
    wing(m, -1, "white", "wingWhite", p.flap, 0);    wing(m, 1, "black", "wingBlack", p.flap, 3);⋯      const EYE = { a: "ink", W: "eyW", A: "eyA", B: "eyB", w: "eyW", b: "blush" };      const L = p.blink ? ["....", "....", "aaaa", ".a..", "....", "b..."] : [".aaa", "aAWA", "aABA", "aBBA", ".ww.", "b..."];      const R = L.map((row) => [...row].reverse().join(""));      m.part("face", () => {        for (const [s, rows] of [[-1, L], [1, R]]) {          // 目の面がカメラから 70° 以上そっぽを向いたら描かない(縁で頭蓋の外へ剥がれるため)          if (Math.cos((az + s * 28) * Math.PI / 180) < 0.34) continue;          m.group({ pivot: [s * 3.5, 40, 7.8], axis: "y", angle: s * 28 }, () => m.art({ at: [s * 3.5 - 2, 43, 8.3], rows, legend: EYE }));        }        m.art({ at: [0, 37, 8.4], rows: ["m"], legend: { m: "mouth" } });      });

L145–163: Separate solid.sdf.subtract halo(t) and smoothstep turnAzimuth(t) with front/back holds run alongside continuous idle(t) secondary motion.

fledgling-angel.ts · 145–163
function halo(t) {  const m = solid.model();  const breath = idle(t).lift;  const flicker = Math.sin(t * Math.PI * 2 * 3) > 0.6;  m.part("halo", () => m.sdf(solid.sdf.subtract(    solid.sdf.rotate(solid.sdf.torus(6, 0.8), 0, -18, 0),    solid.sdf.translate(solid.sdf.box([4, 4, 4]), [5.5, 0, 2])), {    at: [0, 57 + breath, -1], mat: flicker ? "haloDim" : "halo", bounds: [[-8, -4, -8], [8, 4, 8]] }));  return m;}// 宣伝用の turn:正面で止まって芝居を見せ、背面へ回り、背面でも止まり、正面へ戻る(6 秒)。const smooth = (x) => x * x * (3 - 2 * x);function turnAzimuth(t) {  if (t < 0.2) return 0;  if (t < 0.5) return 180 * smooth((t - 0.2) / 0.3);  if (t < 0.7) return 180;  return 180 * (1 - smooth((t - 0.7) / 0.3));}

L165–182: Single camera view + solid.paint(..., outline: { key: "ink", inner: 2.5 }) + g.detached(...) shadow/halo + 5-variant submit() export.

fledgling-angel.ts · 165–182
const Angel = sprite(pal, (g, t, mode = "idle", azimuth = 0) => {  const az = mode === "turn" ? turnAzimuth(t) : azimuth;  const view = { materials: MATS, azimuth: az, elevation: 14, at: [32, 61] };  // 床の影:浮くほど小さく。体とは離れているのが意図なので g.detached で宣言する  const lift = idle(t).lift, half = 7 - 1.5 * lift;  g.detached("shadow", () => g.depth(50, () => g.ellipse({ x: [32 - half, 32 + half], y: [60, 61] }, "shadow", { fill: "shadow" })));  solid.paint(g, angel(t, az), { ...view, smooth: 2, outline: { key: "ink", inner: 2.5 } });  g.detached("halo", () => solid.paint(g, halo(t), view));});submit(Angel, {  size: [64, 64], origin: "top-left", scale: 4, kind: "character",  animate: { fps: 12, duration: 6, loop: true }, anchor: { x: 32, y: 61 },  variants: [    ...[["front", 0], ["right", 90], ["back", 180], ["left", 270]].map(([f, az]) => ({ name: `angel_idle-${f}`, args: ["idle", az] })),    { name: "angel_turn", args: ["turn", 0] },  ],});

Checklist for Clean 3D-to-Pixel Turnarounds

A single 3D solid.model() replaces hand-drawn multi-angle redraws only when facial features and outlines respect pixel-grid geometry. Tilting eye planes to follow the skull and culling past ~70° keeps oblique profiles clean without special-casing individual frames.

Separating floating props and shadows into g.detached(...) preserves crisp 1 px #2e1d2e inner depth lines on the character while keeping palette and alpha counts strictly quantized across all 360 frames.

  • Model asymmetric parts explicitly (left white droop=0 vs right black droop=3) instead of mirroring 90° renders.
  • Tilt left/right eye groups ±28° onto the skull curve and cull when cos(az + s * 28°) < 0.34 (~70.1°).
  • Use solid.paint(..., { smooth: 2, outline: { key: "ink", inner: 2.5 } }) for 1 px outer and depth-step outlines.
  • Move ground shadows and detached props like halo(t) into g.detached(...) and verify 0 off-palette / 0 partial-alpha pixels.

Inspect fledgling-angel.ts inside Tessarune 1.5.0

Fledgling Fallen Angel ships as a built-in sample in Tessarune 1.5.0, so you can copy it into a local workspace, tweak wing droop or eye-cull thresholds, and re-render all 5 variants (360 frames at 64×64) directly.