Giter Club home page Giter Club logo

cub3d's Introduction

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!

cub3d's People

Contributors

degef avatar aandom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.