Skip to content

A real-time ASCII-rendered 3D torus built with pure Python and NumPy. Extremely unnecessary, yet beautiful.

Notifications You must be signed in to change notification settings

MustafaUsman1/-3D-ASCII-Donut-Parametric-Torus-Rendering-in-a-Terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

🍩 ASCII Torus Renderer | A Spiraling 3D Donut in Pure Python

ASCII Donut Demo

This project renders a fully rotating 3D torus (donut) inside your terminal using nothing but Python, NumPy, trigonometry, and raw ASCII characters.
It’s a tiny experiment in parametric surfaces, Euler-angle rotation, depth buffering, and terminal-based shading—all wrapped into one hypnotic spiraling animation.

🧠 What’s Happening Here?

The donut is generated using the parametric equations of a torus, rotated through two independent angles A and B, then projected onto a 2D terminal grid using a handmade perspective model:

  • Parametric geometry: (R + cos(i)) * cos(j)
  • Euler rotations: applied across X and Z axes
  • Depth buffer: prevents far-side glyphs from overwriting near ones
  • ASCII luminance ramp: gives the illusion of lighting and curvature

In short:
Real math. Fake graphics card. Very real donut. hehe

🚀 Run It

python donut.py

About

A real-time ASCII-rendered 3D torus built with pure Python and NumPy. Extremely unnecessary, yet beautiful.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages