{"id":29719485,"url":"https://github.com/phlearning/cub3d","last_synced_at":"2025-07-24T11:44:24.471Z","repository":{"id":232202876,"uuid":"680097542","full_name":"phlearning/cub3d","owner":"phlearning","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-26T16:09:57.000Z","size":16284,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-27T19:41:37.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phlearning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-08-18T10:34:33.000Z","updated_at":"2024-06-26T16:10:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"17d433c7-9113-4df8-b43d-b7c79bf6d062","html_url":"https://github.com/phlearning/cub3d","commit_stats":null,"previous_names":["phlearning/cub3d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phlearning/cub3d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlearning%2Fcub3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlearning%2Fcub3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlearning%2Fcub3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlearning%2Fcub3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phlearning","download_url":"https://codeload.github.com/phlearning/cub3d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlearning%2Fcub3d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266836344,"owners_count":23992596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"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":[],"created_at":"2025-07-24T11:44:23.009Z","updated_at":"2025-07-24T11:44:24.447Z","avatar_url":"https://github.com/phlearning.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cub3D\r\n\r\n## Table of Contents\r\n\r\n- [Cub3D](#cub3d)\r\n\t- [Table of Contents](#table-of-contents)\r\n\t- [About ](#about-)\r\n\t\t- [What is raycasting ?](#what-is-raycasting-)\r\n\t- [Getting Started ](#getting-started-)\r\n\t\t- [Prerequisites](#prerequisites)\r\n\t\t- [Installing](#installing)\r\n\t- [Usage ](#usage-)\r\n\t- [Authors ](#authors-)\r\n\t- [Acknowledgements ](#acknowledgements-)\r\n\r\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\r\n\r\nThis project is inspired by the world-famous Wolfenstein 3D game, which was the first FPS ever. It will enable you to explore ray-casting. Your goal will be to make a dynamic view inside a maze, in which you’ll have to find your way.\r\n\r\n### What is raycasting ?\r\n\r\nRaycasting is a rendering technique used in computer graphics and game development. The basic idea is to trace a path from an eye point (the camera), through a pixel on the screen, into the scene, and then determine what object in the scene is visible through that pixel.\r\n\r\nThis is done by \"casting\" a \"ray\" from the eye point, through the pixel, and into the scene, and checking for intersections with objects in the scene. The first object that the ray intersects is the one that is visible through that pixel.\r\n\r\nRaycasting is used in a variety of applications, including 3D rendering, hit detection in games, and more. It's the basis for ray tracing, a more advanced and realistic rendering technique that simulates the actual physics of light.\r\n\r\n\u003cp align=\"center\" styles=\"italic bold\"\u003e\r\n\t\u003cb\u003e\u003ci\u003eImage from https://hackaday.com/2021/09/13/ray-casting-101-makes-things-simple/\u003c/i\u003e\u003c/b\u003e\r\n\t\u003cimg src=\"images/raycasting.gif\" alt=\"raycasting_gif\"\u003e\r\n\u003c/p\u003e\r\n\r\n## Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\r\n\r\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\r\n\r\n### Prerequisites\r\n\r\n - Make (to automate the compilation of the code)\r\n - Either GCC or Clang can be used as the compiler\r\n\r\n### Installing\r\n\r\n  1. Git clone the code\r\n     ```\r\n     git clone https://github.com/phlearning/cub3d.git\r\n     ```\r\n  2. Compile the code\r\n     - Execute with `make` in your terminal while in the same folder as the makefile\r\n  3. Run the app cub3D\r\n     - Execute with `./cub3D map/cub3D.cub` in your terminal while in the same folder as the executable\r\n\r\n## Usage \u003ca name = \"usage\"\u003e\u003c/a\u003e\r\n\r\n- WASD are the default movement.\r\n- Left arrow / Right arrow are the default keys to rotate the view.\r\n- To run the app with different map: `./cub3D {path_to_map}`\r\n  - The map is made in such format:\r\n\t```\r\n\tNO ./textures/xpm/bluestone.xpm\r\n\tSO ./textures/xpm/colorstone.xpm\r\n\tWE ./textures/xpm/greystone.xpm\r\n\tEA ./textures/xpm/mossy.xpm\r\n\r\n\tF 102,106,110\r\n\tC 199,228,255\r\n\r\n\t1111111111111111\r\n\t1E00000000000001\r\n\t1000001000000001\r\n\t1000001100000001\r\n\t1000000000000001\r\n\t1111000000000000001\r\n\t1000001000000001111\r\n\t1000000000100001\r\n\t1111111111111111\r\n\t```\r\n\tThe NO, SO, WE, EA represent the wall textures depending on each direction (North, South, West, East).\r\n\r\n\tThe F and the digits represents the Floor color in RGB.\r\n\tRespectively, C represents the Ceiling color in RGB.  \r\n\r\n\tThe map is configured with the 1 being the wall, 0 being the walkable space and the E being the player initial position looking at the East direction when spawned in.\r\n\tAvailable direction:\r\n\t- N - North\r\n\t- E - East\r\n\t- W - West\r\n\t- S - South\r\n\r\n\r\n## Authors \u003ca name = \"authors\"\u003e\u003c/a\u003e\r\n\r\n- [bkukaqi](https://github.com/Rimble5)\r\n- [pvong](https://github.com/phlearning)\r\n\r\n## Acknowledgements \u003ca name = \"acknowledgements\"\u003e\u003c/a\u003e\r\n\r\n- [Introduction to ray casting in 2D game engines](https://sszczep.dev/blog/ray-casting-in-2d-game-engines) (Show the maths and optimization possible)\r\n- [Lode's Computer Graphics Tutorial Raycasting](https://lodev.org/cgtutor/raycasting.html) (Really useful)\r\n- [Challenge ray-casting-2d](https://thecodingtrain.com/challenges/145-ray-casting-2d) (To understand raycasting in javascript)\r\n- https://www.youtube.com/watch?v=g8p7nAbDz6Y (Raycasting)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlearning%2Fcub3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphlearning%2Fcub3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlearning%2Fcub3d/lists"}