A group of cool 3D stimulation programs that can be run in terminal created by first stimulating 3d shapes in space and then projecting them on the terminal screen.
This repository contains the following 3D animations: most of them are just tweaking the original work.
- Spinning Donut in python
- Spinning Donut in C (By Andy Sloane )
- Spinning Cube in C (By Servet Gulnaroglu)
- Spinning hollow cube in C
- Spinning cube illusion in C
- Spinning cube with illumination
- Spinning Tetrahedron in C
- Static sphere in moving light
Each program is designed to run in the terminal, providing a simple yet captivating visual experience.
To compile and run these programs, you will need:
- A C compiler (e.g.,
gcc
installed default in most linux distros) - A terminal emulator that supports ASCII output
To run the programs, two ways:
-
Clone this repository:
git clone https://github.com/haleel/terminator.git cd terminator // If C file gcc name-of-the-file-wanted-to-run.c -lm ./a.out // If python python3 name-of-file.py
eg:
// If C file gcc cube.c -lm ./a.out // If python python3 donut.py
-
Copy the file wanted to run from this repo and paste it to a new file created in local system:
// If C file gcc name-of-the-file-wanted-to-run.c -lm ./a.out // If python python3 name-of-file.py
eg:
// If C file gcc cube.c -lm ./a.out // If python python3 donut.py
In python
In C
Here unlike the cases before the cube's shade changes as it spin. In previous cases each side has predefined color, but here it is assumed that there is a light behind the viewer to the right, hence that face will look illuminated based on the angle it makes with the spinning faces.
Contributions are welcome! If you have an idea for a new 3D shape or an improvement to an existing one, please feel free to fork this repository and submit a pull request.
This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. You are free to use the code for personal purposes, but you are not allowed to distribute or commercialize it.