About the project | Technologies | Getting started | How to contribute | License
This 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.
Note:You can check the Cub3d.pdf-
The idea behind ray casting is to trace rays from the eye, one per pixel, and find the closest object blocking the path of that ray – think of an image as a screen-door, with each square in the screen being a pixel. This is then the object the eye sees through that pixel.
-
Understanding the basics of 3D rendering and graphics.
-
Learning about the intersection of rays and objects in 3D space.
-
Developing problem-solving skills in a graphical context.
The system integrates multiple components to ensure a seamless and interactive 3D rendering process:
-
Ray-Casting Algorithm: Implemented in C, handling the core logic of tracing rays and detecting intersections with objects.
-
3D Rendering: Utilizing the MiniLibX library for rendering the 3D environment.
-
Initialization: Setting up the 3D environment and initializing the ray-casting algorithm.
-
Ray-Casting: Tracing rays from the eye, one per pixel, and detecting intersections with objects.
-
Rendering: Rendering the 3D environment based on the intersection points and object properties.
Technologies used to develop Cub3D:
- C Compiler: Ensure you have a C compiler installed (e.g., GCC).
- MiniLibX Library: Ensure you have the MiniLibX Library installed.
1. Clone the project and access the folder
git clone https://github.com/HishamEltayb/Cub3d.git && cd Cub3d2. Use Makefile
make -j && make run3. Movement and Rotation
| Key | Action |
|---|---|
| W | Move forward |
| S | Move backward |
| A | Move left |
| D | Move right |
| → (Right arrow) | Rotate right |
| ← (Left arrow) | Rotate left |
Make a fork of this repository
# Fork using GitHub official command line
# If you don't have the GitHub CLI, use the web site to do that.
$ gh repo fork HishamEltayb/Cub3dFollow the steps below
Clone your fork
$ git clone your-fork-url && cd Cub3dCreate a branch with your feature
$ git checkout -b my-featureMake the commit with your changes
$ git commit -m 'feat: My new featureSend the code to your remote branch
$ git push origin my-featureThis project is licensed under the MIT License - see the LICENSE file for details.
This project is a group effort, and I would like to extend a heartfelt thank you to Ali Hussain for his exceptional work and expertise. His contributions were invaluable to the success of this project.