{"id":19675460,"url":"https://github.com/kuninoto/42_cub3d","last_synced_at":"2026-05-15T04:03:11.722Z","repository":{"id":157766191,"uuid":"608781781","full_name":"Kuninoto/42_cub3D","owner":"Kuninoto","description":"A simple 3D 'game' using MinilLibX (mlx), the graphic library of the 42School and the raycasting algorithm","archived":false,"fork":false,"pushed_at":"2025-03-28T21:36:45.000Z","size":69464,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T02:28:14.101Z","etag":null,"topics":["1337school","21school","42","42-cub3d","42born2code","42cursus","42ecole","42porto","42portugal","42project","42projects","42school","cub3d","ecole42","raycasting","raycasting-algorithm","school42"],"latest_commit_sha":null,"homepage":"","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/Kuninoto.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-03-02T18:14:38.000Z","updated_at":"2025-10-03T22:16:24.000Z","dependencies_parsed_at":"2023-10-05T05:22:24.700Z","dependency_job_id":null,"html_url":"https://github.com/Kuninoto/42_cub3D","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kuninoto/42_cub3D","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuninoto%2F42_cub3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuninoto%2F42_cub3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuninoto%2F42_cub3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuninoto%2F42_cub3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kuninoto","download_url":"https://codeload.github.com/Kuninoto/42_cub3D/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kuninoto%2F42_cub3D/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33053144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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":["1337school","21school","42","42-cub3d","42born2code","42cursus","42ecole","42porto","42portugal","42project","42projects","42school","cub3d","ecole42","raycasting","raycasting-algorithm","school42"],"created_at":"2024-11-11T17:24:13.014Z","updated_at":"2026-05-15T04:03:11.714Z","avatar_url":"https://github.com/Kuninoto.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cub3D (42Porto - 42Cursus)  \n\n#### Project done in collaboration with [Rodrigo Ramos](https://github.com/ramos21rodrigo)  \n\n### Demonstration  \n\n![](./extras/showcase.gif)\n\n## Description  \n\nVery basic 3D graphical representation of the inside of a maze from a first-person perspective using [Ray casting](https://en.wikipedia.org/wiki/Ray_casting) - introduction to 3D graphics programming.\n\n## Grade: 115/100  \n\n### Installing and running cub3D  \n\n1- Installing dependencies\n\n\tsudo apt-get install make xorg libxext-dev zlib1g-dev libbsd-dev\n2- Clone this repository:  \n\n\tgit clone https://github.com/Kuninoto/42_cub3D\n3- Compile and clean the object files that you won't need anymore  \n\n\tmake \u0026\u0026 make clean\n4- Run cub3D with your desired map\n\n\t./cub3D \u003cpath/to/scene\u003e.cub\n\n### Controls  \n\n\tESC - Quit cub3D\n\tW A S D / Arrows - Player movement\n\tMouse - Move Player's camera \n\n### Creating new scenes  \n\n\tScene elements:\n\t\t'NO' - North texture file path;\n\t\t'SO' - South texture file path;\n\t\t'EA' - East texture file path;\n\t\t'WE' - West texture file path;\n\n\t\t'F' - Floor color in RGB;\n\t\t'C' - Ceiling color in RGB;\n\tMap:\n\t\t'0' - Free space;  \n\t\t'1' - Wall;  \n\t\t'N', 'S', 'E', 'W' - Player's starting position\n\t\t(and which coordinate he will be facing at spawn);  \n\n\tTo be valid, a scene must respect the following:\n\t\t- Be in .cub file extension;\n\t\t- All textures must be 64x64 and be in XPM format;  \n\tThe map must:\n\t\t- Be composed only by valid characters;  \n\t\t- Be closed by walls;  \n\t\t- Contain only one Player;  \n\t(You can check examples of valid scenes on /scenes);\n\n#### Makefile available targets  \n`make` or `make all` - compiles `cub3D`  \n`make clean` - wipes all object files  \n`make fclean` - deletes `cub3D` and all object files  \n`make re` - `fclean` + `all`  \n\n## NOTES\nThis project was developed for Linux. Although we've added and decided to  keep conditional compilation and the graphics library for macOS (which do not have some functions that Linux has), it was for development and test purposes only.  \n\nFor 42 students:\n`mlx_mouse_hide()` has memory leaks product of the mlx library. That's why running this cub3D on a sucessful run with valgrind outputs exactly 28,772 still reachable bytes in 293 blocks.\nIf you wish to check valgrind without the boycotted memory leakage comment `mlx_mouse_hide()` on line 26 of main.c.  \n\n## Useful links  \n[What is Raycasting?](https://en.wikipedia.org/wiki/Ray_casting)  \n[Raycasting implementation](https://lodev.org/cgtutor/raycasting.html)  \n[MLX documentation](https://harm-smits.github.io/42docs/)  \n\n## Disclaimer  \n\u003e At [42School](https://en.wikipedia.org/wiki/42_(school)), almost every project must be written in accordance to the \"Norm\", the schools' coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.\n\n---\nMade by Nuno Carvalho (Kuninoto) | nnuno-ca@student.42porto.com  \n\u003cdiv id=\"badge\"\u003e \u003ca href=\"https://www.linkedin.com/in/nuno-carvalho-218822247\"/\u003e \u003cimg src=\"https://img.shields.io/badge/LinkedIn-blue?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\" alt=\"LinkedIn Badge\"/\u003e\u0026nbsp;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuninoto%2F42_cub3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuninoto%2F42_cub3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuninoto%2F42_cub3d/lists"}