{"id":17711777,"url":"https://github.com/zank613/minifb_raycaster","last_synced_at":"2026-02-06T23:33:05.660Z","repository":{"id":259285155,"uuid":"876963334","full_name":"Zank613/minifb_raycaster","owner":"Zank613","description":"Raycaster in C","archived":false,"fork":false,"pushed_at":"2024-10-28T14:13:18.000Z","size":522,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T15:07:53.681Z","etag":null,"topics":["3d","c","c99","raycasting","software-rendering","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zank613.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}},"created_at":"2024-10-22T21:09:35.000Z","updated_at":"2024-10-28T14:13:21.000Z","dependencies_parsed_at":"2024-11-02T20:31:28.358Z","dependency_job_id":null,"html_url":"https://github.com/Zank613/minifb_raycaster","commit_stats":null,"previous_names":["zank613/minifb_raycaster"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zank613%2Fminifb_raycaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zank613%2Fminifb_raycaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zank613%2Fminifb_raycaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zank613%2Fminifb_raycaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zank613","download_url":"https://codeload.github.com/Zank613/minifb_raycaster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251895479,"owners_count":21661345,"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":["3d","c","c99","raycasting","software-rendering","wolfenstein-3d"],"created_at":"2024-10-25T08:07:54.396Z","updated_at":"2026-02-06T23:33:05.615Z","avatar_url":"https://github.com/Zank613.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniFB Raycaster\n\n![The Raycaster](/assets/raycaster_6.png \"Raycaster\")\n\n## Overview\n\nMiniFB Raycaster is a simple raycasting engine built using the MiniFB library. It demonstrates basic 3D rendering techniques using 2D raycasting. The engine now supports loading custom textures from external image files specified in a configuration file, allowing for greater flexibility and customization.\n\n## Features\n\n- Basic 3D rendering using raycasting\n- **Support for custom textures loaded from image files**\n- Simple and lightweight\n- Cross-platform support\n- Static sprite rendering\n\n## Requirements\n\n- C compiler (GCC, Clang, etc.)\n- CMake\n- [MiniFB](https://github.com/emoon/minifb) library\n- [stb_image.h](https://github.com/nothings/stb/blob/master/stb_image.h) (included in the project)\n- Image files for textures (e.g., PNG files)\n\n## Installation\n\n1. **Clone the repository:**\n\n    ```sh\n    git clone --recursive https://github.com/Zank613/minifb_raycaster.git\n    ```\n\n2. **Navigate to the project directory:**\n\n    ```sh\n    cd minifb_raycaster\n    ```\n\n3. **Place your texture images in the `assets` directory:**\n\n    - Create an `assets` directory if it doesn't exist:\n\n      ```sh\n      mkdir assets\n      ```\n\n    - Add your texture image files (e.g., `wall1.png`, `wall2.png`, etc.) to the `assets` directory.\n\n4. **Create or modify the texture configuration file:**\n\n    - Create a file named `textures.conf` in the project's root directory.\n\n    - Specify the texture IDs and corresponding file paths in `textures.conf`. For example:\n\n      ```\n      1 assets/wall1.png\n      2 assets/wall2.png\n      3 assets/wall3.png\n      4 assets/wall4.png\n      5 assets/wall5.png\n      6 assets/wall6.png\n      7 assets/wall7.png\n      8 assets/wall8.png\n      ```\n\n    - Make sure the texture IDs match those used in the `worldMap` in `world_map.c`.\n\n5. **Create a build directory and navigate into it:**\n\n    ```sh\n    mkdir build \u0026\u0026 cd build\n    ```\n\n6. **Generate the build files using CMake:**\n\n    ```sh\n    cmake ..\n    ```\n\n7. **Build the project:**\n\n    ```sh\n    cmake --build .\n    ```\n\n## Usage\n\n### Run the executable:\n\n```sh\n./minifb_raycaster\n```\n\nThe default player starts at position (22.0, 12.0) in the map, facing in the negative X direction. The game window will open, and you can use the WASD keys to move the player around.\n\n## Controls\n- W: Move forward\n\n- S: Move backward\n\n- A: Rotate left\n\n- D: Rotate right\n\n- Escape: Exit the application\n\n## Customization\n### 1. Add Texture Images:\n - Place your custom image files (e.g, PNG files) in the assets directory.\n### 2. Update configuration file:\n - Edit \"textures.conf\" to include your new textures.\n\n - Each line should contain a texture ID and the path to the image file.\n\n - Example:\n    ```sh\n    1 assets/brick_wall.png\n    2 assets/stone_wall.png\n    3 assets/wood_wall.png\n    ```\n - Ensure that the texture IDs correspond to the values used in the worldMap.\n### Modify the World Map:\n - Edit world_map.c to use the new texture IDs in the worldMap array.\n\n - Example:\n    ```C\n    int worldMap[MAP_HEIGHT][MAP_WIDTH] = {\n    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n    {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},\n    {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},\n    // ... rest of the map ...\n    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n    };\n    ```\n - Replace the numbers in the map with the texture IDs corresponding to your textures.\n\n### Modifying the Player's starting position\n - Modify the player's starting position and direction in the Player struct in raycasting.c to change the initial state.\n ```C\n Player player = {\n    .x = 22.0,    // Player's initial x position\n    .y = 12.0,    // Player's initial y position\n    .dirX = -1.0, // Player's initial direction on X-axis\n    .dirY = 0.0,  // Player's initial direction on Y-axis\n    .planeX = 0.0,\n    .planeY = 0.66\n };\n ```\n\n### Creating Your Own Maps\n - You can modify the worldMap to create your own levels or maps by changing the values of the 2D array in the worldMap[MAP_HEIGHT][MAP_WIDTH] grid.\n\n - Use 0 for empty spaces and texture IDs (e.g., 1, 2, 3, etc.) to represent walls with different textures.\n\n## Compilers Tested\n - **GCC (MinGW on Windows)**: Succesfully run without issues.\n\n - **MSVC (Microsoft Visual Studio)**: Segmentation faults encountered during build.\n\n## Contributing\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/Zank613/minifb_raycaster/blob/master/LICENSE) file for details.\n\n## Acknowledgements\n - [MiniFB](https://github.com/emoon/minifb) for the framebuffer library.\n - [stb_image.h](https://github.com/nothings/stb/blob/master/stb_image.h) for image loading.\n - [Lode Vandevenne](https://lodev.org/cgtutor/raycasting.html) for raycasting tutorial.\n - [areyep.com](https://www.areyep.com/) for permission to use the textures included in the assets/textures.\n\n## Additional Screenshots\n\n![The Raycaster](/assets/raycaster_7.png \"Raycaster\")\n![The Raycaster](/assets/raycaster_1.png \"Raycaster\")\n![The Raycaster](/assets/raycaster_4.png \"Raycaster\")\n![The Raycaster](/assets/raycaster_5.png \"Raycaster\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzank613%2Fminifb_raycaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzank613%2Fminifb_raycaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzank613%2Fminifb_raycaster/lists"}