Skip to content

Degef/Cub3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 

Repository files navigation

Cub3D Project

recording1

Overview

Welcome to the Cub3D project! This project was successfully completed by me and Alexander as part of our coursework at 42 Abu Dhabi. Cub3D is an exciting venture into the world of 3D graphics, built upon the fascinating ray casting technique. In this project, we convert a 2D array map into a mesmerizing 3D world.

Graphics Library

For window graphic management in this project, we utilized the MLX library, which is a basic graphic library. MLX provided us with the essential tools and functions to create and render the 3D environment, manage user input, and handle graphical elements effectively.

Key Features

Ray Casting Magic

Our project harnesses the power of ray casting to transform a 2D map into a 3D wonderland. By skillfully manipulating rays, we bring depth and dimension to what was once a flat surface. This technique allows us to create the illusion of 3D environments in real-time.

...

Textured Walls

We take our project a step further by adding textures to the walls. Each cardinal direction (north, south, east, and west) is adorned with its distinct texture, enhancing the immersive experience. The variation in textures adds realism and depth to our virtual world.

Player Controls

Players can explore the 3D environment with intuitive controls. Use the WASD keys to move forward, backward, left, and right. To change your viewpoint, employ the arrow keys for rotation. These controls provide a smooth and engaging user experience, making exploration a breeze.

MiniMap

To keep players oriented in our 3D world, we've implemented a minimap. This handy feature displays the player's current position on the map and provides a visual representation of all the rays being cast. It's a helpful tool for navigating the environment and understanding the ray-casting process.

Error Handling

We've taken care to ensure robust error handling. Our project can gracefully handle various error scenarios that might arise from an invalid map. Whether it's an unclosed border or missing elements, we've got it covered. Users can expect a stable and reliable experience.

Getting Started

To get started with Cub3D, follow these steps: Note: This will work in a Mac or Linux environment only. Also use mlx_linux if you are trying this in linux environment. you can do this by changing the "mlx" in the Makefile to "mlx_linux".

  1. Clone this repository to your local machine.
  2. Compile the project by writing "make all" at the root of the project.
  3. Run the executable with a valid map as argument (./cub3D maps/cub.cub).
  4. Explore the captivating 3D world we've created using the controls mentioned above.
  • Note: This will work in Mac and Linux environments only.

Demo

recording

Contributions and Feedback

We welcome contributions and feedback from the community. If you have ideas for improvements or want to report issues, please open an issue or submit a pull request. Your input is valuable and can help us make Cub3D even better!

About

Cub3D is an exciting venture into the world of 3D graphics, built upon the fascinating ray casting technique.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors