{"id":22868160,"url":"https://github.com/faruktinaz/cub3d","last_synced_at":"2025-06-20T06:36:17.384Z","repository":{"id":209637284,"uuid":"719773293","full_name":"faruktinaz/cub3d","owner":"faruktinaz","description":"The goal of cub3d is to make something using raycasting (like Wolfenstein 3D).","archived":false,"fork":false,"pushed_at":"2024-01-19T23:17:56.000Z","size":6078,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T10:49:52.077Z","etag":null,"topics":["cub3d","dda","raycasting","wolfenstein-3d"],"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/faruktinaz.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-11-16T21:47:12.000Z","updated_at":"2024-03-18T08:09:15.000Z","dependencies_parsed_at":"2024-01-19T22:41:51.696Z","dependency_job_id":"16d32748-b0b6-4603-9893-2eebfb405c1a","html_url":"https://github.com/faruktinaz/cub3d","commit_stats":null,"previous_names":["faruktinaz/cub3d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faruktinaz/cub3d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faruktinaz%2Fcub3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faruktinaz%2Fcub3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faruktinaz%2Fcub3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faruktinaz%2Fcub3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faruktinaz","download_url":"https://codeload.github.com/faruktinaz/cub3d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faruktinaz%2Fcub3d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260897192,"owners_count":23079211,"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","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":["cub3d","dda","raycasting","wolfenstein-3d"],"created_at":"2024-12-13T12:31:54.013Z","updated_at":"2025-06-20T06:36:12.366Z","avatar_url":"https://github.com/faruktinaz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cub3D\n### Wolfenstein 3D inspired Raycasting project\n\nThe goal of ``cub3d`` is to make *something* using raycasting (like [Wolfenstein 3D](https://fr.wikipedia.org/wiki/Wolfenstein_3D)).\n\n### How to run it on linux and macOS ?\n\nWhen you clone the files, by default the linux version of the MLX library is included. If you want to run it on macOS, you need to download the macOS version of MLX and place it in the srcs/library/ file path. \nthen just type `\"make linux\"` or `\"make macos\"`.\n\n![Screenshot from 2024-01-20 01-31-46](https://github.com/faruktinaz/cub3d/assets/114104599/1982bfa9-1ded-4c93-9bab-779af13ec365)\n\n\u003c/br\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./srcs/texture/cub3d.gif\" width=75%\u003e\n\u003c/p\u003e\n\u003c/br\u003e\n\n- WASD to move \n- Left-Right directional keys to rotate camera\n- ESC to quit\n\n### map\n\nyou can change the map according to the rules.\n\n```\nNO srcs/texture/north.xpm\nSO srcs/texture/south.xpm\nWE srcs/texture/west.xpm\nEA srcs/texture/east.xpm\n\nC 81, 176, 219\nF 64, 41, 10\n\n        11111111111 11111111111111\n        10000000011100000000000011111\n        1011000001110000011100001001\n        1100100000000000000100000111\n111111110110000011100000111000011\n100000000011000001110111111111111\n11110111111111011100000010001\n11110111111111011101010010001\n11000000110101011100000010001\n100000000E0000011000000100001\n10000000000000001101010010001\n11000001110101011111011110001\n11110111 1110101 101111010001\n11111111 1111111 111111111111\n```\n\n- NO, SO, WE, EA texture of the direction of the wall.\n- C, F is ceiling and floor rgb colors.\n\nWhen creating the rays using the DDA algorithm and mlx_put_pixel, for each step I divided the current position of the ray by 64 and checked if there is 1 (i.e. wall) in the map. If there is a wall, I subtracted the x and y coordinates of the last pixel of the line from the x and y coordinates of the character and used a simple Pythagorean theorem to store the lengths of the ray in an array.\n\n\u003cimg src=\"https://github.com/faruktinaz/cub3d/assets/114104599/07bce3cd-95df-4a71-ad68-c3d2e40a4728\" width=\"600\" height=\"500\"\u003e\n\n---\n\n\u003cimg src=\"https://github.com/faruktinaz/cub3d/assets/114104599/86f1f843-ec5c-46e0-8a79-ce774430a5f9\" width=\"600\" height=\"500\"\u003e\n\n```c\ndata-\u003edistances[data-\u003ejd] = (sqrt(pow(data-\u003ep_x + 8 - data-\u003evar.x_d, 2) + pow(data-\u003ep_y + 8 - data-\u003evar.y_d, 2)) * cos(data-\u003ecurrent_angle - data-\u003evar.pa));\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaruktinaz%2Fcub3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaruktinaz%2Fcub3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaruktinaz%2Fcub3d/lists"}