Skip to content
/ donut.c Public

A donut generated by revolving a circle in three-dimensional space about an axis that is coplanar with the circle.

Notifications You must be signed in to change notification settings

aguunu/donut.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍩 donut.c

A donut generated by revolving a circle in three-dimensional space about an axis that is coplanar with the circle.

This code is an implementation of a simple 3D graphics program that creates an ASCII art animation of a spinning torus (donut shape). The torus is created using mathematical rotations in 3D space, and then projected onto a 2D screen using a simple perspective projection formula. The frames are displayed on the console using ASCII characters, where different characters are used to represent different levels of brightness (luminance) calculated from the surface normal of the torus.

About

A donut generated by revolving a circle in three-dimensional space about an axis that is coplanar with the circle.

Resources

Stars

Watchers

Forks