https://github.com/davi0805/cub3d-ray-casting-
[Ray Casting] 3d game based on wolfenstein
https://github.com/davi0805/cub3d-ray-casting-
Last synced: 3 months ago
JSON representation
[Ray Casting] 3d game based on wolfenstein
- Host: GitHub
- URL: https://github.com/davi0805/cub3d-ray-casting-
- Owner: Davi0805
- Created: 2025-01-08T12:15:35.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-11T16:42:46.000Z (3 months ago)
- Last Synced: 2025-03-11T17:31:42.913Z (3 months ago)
- Language: C
- Homepage:
- Size: 47.2 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cub3D
## Demo

## Description
Cub3D is a project from 42 where you transform a 2D tiled map into a 3D environment, inspired by classic games like Wolfenstein.
The project relies on the MiniLibX graphics library, an API designed to facilitate the creation of basic graphical applications and interaction with windowing systems.
It starts by parsing the map to ensure it follows the correct structure - valid file format, textures and map itself - before moving on to the 3D rendering. For this, we used raycasting with the DDA algorithm to simulate the player’s viewpoint and generate a 3D environment by calculating distances to walls. It’s a hands-on project that teaches graphics programming, raycasting, and algorithm optimization.## Features
- File Validation: Ensures correct map extension, valid file format, valid textures, and proper map formatting.
- Window Management: Handled using the MiniLibX graphics library.
- 3D Rendering: Utilizes raycasting and the DDA algorithm to generate a 3D environment.
- Resource Management: Focuses on making the program error-free and leak-free.
- Player Movement: Movement of the player with WADS, left and right arrow keys## Getting Started
### Dependencies
- **Operating System**: Unix-based OS (Linux or macOS)
- **Libraries**: libX11, libXext, and libm for rendering and mathematical computations.#### Installation on Linux/macOS:
Ensure you have the necessary dependencies installed before proceeding.
- **Debian/Ubuntu**: `sudo apt install libx11-dev libxext-dev libbsd-dev libm-dev`
For MacOS you'll have to switch the minilibx distro on code/lib
### Installing
1. **Clone the Repository**\
Download the project by running:
```
https://github.com/Artur-2k/cub3d
```2. **Navigate to the Project Directory**
```
cd cub3d
```3. **Set Up the Project**
Build or prepare the project with:```
make all
```## Usage
Run the application with the following command:
```
./cub3D Assets/Maps/Valid/
```Move around with WASD keys and rotate the camare with left and right arrow keys
Example:
```
./cub3D Assets/Maps/Valid/library.cub
```## Authors
- [Artur Carvalho](https://github.com/Artur-2k)
- [Davi Melo](https://github.com/Davi0805)