Skip to content

jqrsound/cub3d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3d

Using miniLibX and ray-casting principles we created a “realistic” 3D graphical representation of a maze from a first-person perspective, modelled on the style of Wolfenstein 3D.

Instructions

The program displays the image in a window and respects the following rules:

  1. The left and right arrow keys of the keyboard allow the player to look left and right in the maze.
  2. The W, A, S, and D keys allow the player to move the point of view through the maze.
  3. Pressing ESC will close the window and quit the program cleanly.
  4. Clicking on the red cross on the window’s frame will close the window and quit the program cleanly.

Build

make

Run

./cub3d ./maps/map_tech.ber

Resources

Raycasting is a rendering technique used to create a 3D perspective in a 2D map.

It works by projecting rays from the player’s position at regular angular intervals across their field of view. Each ray travels until it hits a wall, and the distance determines the apparent height of the wall on the screen.

AI was used to handle the mathematics involved in ray casting and the DDA algorithm.

Authors

About

This 42 School project is inspired by the video game Wolfenstein 3D and aims to explore ray-casting using the miniLibX library. The objective is to create a dynamic visualisation within a maze, where the player can move around freely.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages

  • C 95.7%
  • Makefile 4.3%