3D Donut Console Renderer is a small C++ console project that renders a rotating 3D donut using ASCII characters.
The project is inspired by A1k0n's donut from the internet and demonstrates basic 3D rotation, projection, and shading in a terminal window.
Technologies used:
- C++20
- Standard library only
- Console rendering
- Visual Studio 2022 (or compatible)
- Windows / Linux / macOS console
- Clone the repository:
git clone https://github.com/tiagzoc/DonutMath.git
- Go to the .exe file :
Note: you can find it in the x64/Debug folder.
cd x64/Debug
- Open a cmd and write this command:
Note: The list of all possible parameters is after this part.
.\DonutMath.exe -r 128
Note: You can also open the .sln with an IDE and modify the running parameters.
The donut will continuously rotate in the terminal until you close the window.
- Computes 3D coordinates of a torus (donut) in real-time.
- Applies rotation along X, Y, and Z axes.
- Projects 3D points onto 2D console coordinates.
- Calculates simple luminance for ASCII shading.
- Updates the console frame by frame for animation.
- Implemented 3D rotation and projection in a minimal C++ project.
- Learned to render graphics in the console using ASCII.
- Practiced trigonometry, matrices, and frame-based animation.
- Explored performance optimizations for real-time console rendering.
- Add color support in the console.
- Expand to render other 3D shapes.