Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterajhgraham/rotating_ascii_cube
A C++ program that generates a rotating 3D cube using ASCII characters, and you can run it right inside your computer terminal!
https://github.com/peterajhgraham/rotating_ascii_cube
ascii-art
Last synced: 14 days ago
JSON representation
A C++ program that generates a rotating 3D cube using ASCII characters, and you can run it right inside your computer terminal!
- Host: GitHub
- URL: https://github.com/peterajhgraham/rotating_ascii_cube
- Owner: peterajhgraham
- License: mit
- Created: 2024-08-21T14:57:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-21T17:02:52.000Z (3 months ago)
- Last Synced: 2024-08-21T17:31:45.893Z (3 months ago)
- Topics: ascii-art
- Language: C++
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rotating ASCII Cube
A C++ program that generates a rotating 3D cube using ASCII characters. It is designed with dynamic shading and realistic rotation based on concepts within linear algebra such as dot product, vector normalization, as well as the projection and rendering of 3D points onto a 2D screen.
*Enjoy the rotating cube*!
https://github.com/user-attachments/assets/06601427-6c2b-435b-ba5b-ded2195fc7b9
## Directory Structure
```
ASCII_Rotating_Cube/
├── rotating_cube.cpp
├── LICENSE
├── README.md
└── .gitignore
```## Prerequisites
* **C++ Compiler**
* **Terminal** (Unix-like systems recommended)
## Usage
1. **Clone**:
```
git clone https://github.com/peterajhgraham/Rotating_ASCII_Cube.git
cd Rotating_ASCII_Cube
```3. **Compile**:
```
g++ -o rotating_cube rotating_cube.cpp -lm
```4. **Run**:
```
./rotating_cube
```## Customization
* **Rotation Speed:** You can modify the rotation speed by changing the values of `A += 0.02f;` and `B += 0.015f;` in the `rotating_cube.cpp` file
* Increase/decrease the values of A & B proportionately to avoid an uneven and distorted cube* **Cube Size:** Adjust the cube size by modifying the `cubeSize` variable
## Notes
* Best viewed in a terminal with at least 160x44 characters
* The code uses the Bresenham's line algorithm for drawing lines between the cube's vertices