Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k3rs3d/rotate-cube-py
cube!!!
https://github.com/k3rs3d/rotate-cube-py
Last synced: 1 day ago
JSON representation
cube!!!
- Host: GitHub
- URL: https://github.com/k3rs3d/rotate-cube-py
- Owner: k3rs3d
- License: gpl-3.0
- Created: 2023-08-19T21:49:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-19T21:56:39.000Z (over 1 year ago)
- Last Synced: 2024-11-11T10:05:20.859Z (2 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rotating 3D ASCII Cube
This Python script generates a rotating 3D ASCII cube in the terminal.
## How it Works
The script uses basic 3D geometry and rotation matrices to calculate the positions of the cube's vertices as it rotates around different axes. These 3D coordinates are then mapped to terminal coordinates to render the cube using ASCII characters.
The cube is centered within the terminal window, leaving a margin around it to help it remain fully visible. The rotation angles are incrementally updated in a loop to create the animation effect.
## Usage
1. Clone or download this repository to your local machine.
2. Open a terminal or command prompt.
3. Navigate to the directory where the script is located.
4. Run the script using Python: `python main.py`## Customization
- You can adjust the `TERMINAL_WIDTH` and `TERMINAL_HEIGHT` variables to match your terminal's dimensions.
- The `MARGIN_X` and `MARGIN_Y` variables define the margin around the cube within the terminal window.
- Feel free to experiment with different ASCII characters for rendering lines and explore variations to enhance the visual representation.## Note
Keep in mind that the appearance of the cube will vary drastically depending on your terminal's font and settings.
Happy rotating!