demo 17 of 17

🍩donut

The spinning torus, in its two most famous renderings.

Recordings

Both captures below are real iTerm2 sessions running the demo — the same binary renders at pixel resolution where the terminal speaks the kitty graphics protocol, and as ASCII cells everywhere else.

kitty graphics — donut-gfx

A parametric torus is rotated on two axes, perspective-projected, and lit per surface point; a z-buffer keeps the near face in front while each point splats a shaded disc tinted by a palette, with specular highlights toward white.

donut in kitty graphics mode
donut — kitty pixel mode
ASCII cells — donut

Andy Sloane's ASCII donut — the same maths z-buffered onto the cell grid through the .,-~:;=!*#$@ luminance ramp, here coloured by the palette. c cycles palettes and tube shapes.

donut in ASCII cell mode
donut — ASCII cell mode

Controls

KeyAction
spacetumble
mouse clickspin toward the pointer
atoggle autopilot
ccycle palette / shape
+ / -spin speed
q / Escquit

Tuning env vars use the DONUT_* prefix — e.g. DONUT_MAXDIM=1024 for sharper frames, DONUT_CELLS=1 to force cell rendering even on kitty terminals. See the overview for the full tuning table.