Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
/ 42_cub3d Public archive

Cub3D is a 3D raycasting engine developed *entirely in C*.

Notifications You must be signed in to change notification settings

romanmikh/42_cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42 Cub3D 🧊

Cub3D is a Wolfenstein/Doom 3D-inspired raycasting project developed entirely in C as part of the 42 curriculum. It provides a basic 3D rendering engine using raycasting

Features

  • Raycasting Engine: Implements a first-person perspective using raycasting.
  • Textured Walls & Floor Casting: Supports wall textures and basic floor and ceiling rendering.
  • Player Movement: Includes rotation and movement with collision detection.
  • Configurable Map Parsing: Reads .cub files defining walls, textures, and player spawn.

Installation and Usage

  1. Clone the repository:

    git clone https://github.com/romanmikh/42_cub3d.git cub3D
    cd cub3D
    make
    ./cub3D ./maps/pass/corridors.cub
  2. Valgrind output saved in valgrind_out.txt after:

    ulimit -n 1024 # necessary once only, to address 'file descriptor too high' error
    make valgrind

Helpful Resources

  1. https://www.youtube.com/watch?v=8gIhNSAXYcQ&ab_channel=AndrePrihodko (quick intuition)
  2. https://www.youtube.com/watch?v=W5P8GlaEOSI&ab_channel=AbdulBari (detailed introduction)
  3. https://reactive.so/post/42-a-comprehensive-guide-to-cub3d/ (code example)
  4. https://harm-smits.github.io/42docs/projects/cub3d (detailed explanation)

Documentation

/local/path/to/cub3d/html/index.html  # > Files > main.c (in browser)

Opens the interactive function graph, which can help illustrate the function call hierarchy.

Full code map (almost):

Full Code Map

About

Cub3D is a 3D raycasting engine developed *entirely in C*.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published