Show HN: Rotating torus in terminal (but with kitty graphics protocol)

A spinning donut hit the terminal, and the comments instantly got weird, nerdy, and obsessed

TLDR: A developer got a colorful spinning 3D donut working inside a normally plain-text terminal window, turning a niche demo into a crowd-pleaser. Commenters split between simple praise, a tiny compile-error mystery, and hilariously intense enthusiasm for donut-shaped math.

A humble little spinning donut project somehow turned into a full-blown comment-section mood board: part admiration, part bug hunt, part math thirst trap. Andrea showed off a rotating torus — yes, basically a 3D donut — running inside a terminal window, which is usually the place for plain text, not flashy visuals. The creator explained the behind-the-scenes struggle in charmingly chaotic fashion: images had to be converted into a special text-safe format, chopped into chunks, and sent with a very particular command structure just to make the thing appear. The payoff? A colorful, animated donut with lighting, an FPS counter, and major "look what I made" energy.

But the real entertainment was the crowd reaction. One commenter immediately kicked off the tiniest possible scandal by spotting a suspicious #include <_time.h> and basically saying, “I deleted it and everything worked fine.” That’s the kind of low-stakes code drama the internet lives for: is it a typo, a mystery header, or the opening scene of a compile-error detective story? Others were much more wholesome, dropping a clean “Very cool” like a gold star from the teacher.

Then the thread took its sharpest left turn into full nerd ecstasy. One fan declared their love for toruses/tori and urged people to grab pencil and paper because the math is “beautiful.” Another linked a related Reddit post, because no internet creation is complete until someone says, “This reminds me of another thread.” The vibe: equal parts applause, nitpicking, and people becoming emotionally attached to donut geometry.

Key Points

  • The project renders a rotating torus in a terminal using the Kitty Graphics Protocol.
  • The article explains that image data must be base64 encoded and can be sent as RGB, RGBA, or PNG.
  • Base64 encoding is described as converting 3 input bytes into four 6-bit mapped characters with padding when needed.
  • Kitty Graphics Protocol payloads use an escape-sequence format with required control fields for display action, format, width, and height, and support chunking up to 4096 bytes.
  • Using image rendering helped the author visually debug issues such as geometry cuts and inconsistent lighting, and enabled added color and a second light source.

Hottest takes

"commenting it out allowed for a clean compile for me" — pekim
"Very cool." — spwa4
"Man I love toruses/tori" — ComputerPerson
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.