{"id":51004078,"url":"https://github.com/peterajhgraham/rotating-ascii-cube","last_synced_at":"2026-06-20T18:02:55.150Z","repository":{"id":254134669,"uuid":"845599711","full_name":"peterajhgraham/rotating-ascii-cube","owner":"peterajhgraham","description":"A fun C++ program that generates a rotating 3D cube using ASCII characters, and you can run it right inside your computer terminal!","archived":false,"fork":false,"pushed_at":"2026-05-23T19:22:54.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-23T21:19:50.728Z","etag":null,"topics":["ascii-art","cpp","terminal"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterajhgraham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-21T14:57:30.000Z","updated_at":"2026-05-23T19:22:56.000Z","dependencies_parsed_at":"2024-08-21T17:41:55.462Z","dependency_job_id":null,"html_url":"https://github.com/peterajhgraham/rotating-ascii-cube","commit_stats":null,"previous_names":["peterajhgraham/ascii_rotating_sphere","peterajhgraham/ascii_rotating_cube","peterajhgraham/rotating-ascii-cube"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterajhgraham/rotating-ascii-cube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterajhgraham%2Frotating-ascii-cube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterajhgraham%2Frotating-ascii-cube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterajhgraham%2Frotating-ascii-cube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterajhgraham%2Frotating-ascii-cube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterajhgraham","download_url":"https://codeload.github.com/peterajhgraham/rotating-ascii-cube/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterajhgraham%2Frotating-ascii-cube/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34580041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii-art","cpp","terminal"],"created_at":"2026-06-20T18:02:50.370Z","updated_at":"2026-06-20T18:02:55.143Z","avatar_url":"https://github.com/peterajhgraham.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rotating ASCII Cube\n\nReal-time 3D ASCII renderer in C++ with rotation matrix math, z-buffering, and projection in ~150 lines.\n\nA terminal program that spins a cube by composing X and Y rotation matrices each frame - `(y, z) -\u003e (y*cosA - z*sinA, y*sinA + z*cosA)` and the Y equivalent - then projects the rotated vertices onto the screen with a perspective divide: `x' = K*x/(z+d)`, `y' = K*y/(z+d)`. Edges are rasterized with Bresenham's line algorithm. A per-pixel z-buffer keyed on `1/(z+d)` ensures nearer edges overwrite farther ones, giving correct occlusion.\n\nhttps://github.com/user-attachments/assets/06601427-6c2b-435b-ba5b-ded2195fc7b9\n\n## Directory Structure\n\n```\nASCII_Rotating_Cube/\n├── rotating_cube.cpp\n├── LICENSE\n├── README.md\n└── .gitignore\n```\n\n## Prerequisites\n\n* **C++ Compiler**\n\n* **Terminal** (Unix-like systems recommended)\n\n## Usage\n\n1. **Clone**:\n   ```\n   git clone https://github.com/peterajhgraham/Rotating_ASCII_Cube.git\n   cd Rotating_ASCII_Cube\n   ```\n\n3. **Compile**:\n   ```\n   g++ -o rotating_cube rotating_cube.cpp -lm\n   ```\n\n4. **Run**:\n   ```\n   ./rotating_cube\n   ```\n\n## Customization\n\n* **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\n   * Increase/decrease the values of A \u0026 B proportionately to avoid an uneven and distorted cube\n\n* **Cube Size:** Adjust the cube size by modifying the `cubeSize` variable\n\n## Notes\n\n* Best viewed in a terminal with at least 160x44 characters\n\n* The code uses the Bresenham's line algorithm for drawing lines between the cube's vertices\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterajhgraham%2Frotating-ascii-cube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterajhgraham%2Frotating-ascii-cube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterajhgraham%2Frotating-ascii-cube/lists"}