Skip to content
← Johan Idler

cub3d.

C · MiniLibX · Raycasting · Linear algebra

Cub3D is a Wolfenstein 3D-inspired raycasting engine that renders a first-person perspective from a two-dimensional tile map in real time. I built it in C with MiniLibX and no external rendering framework.

The engine parses a .cub map and turns it into a navigable environment using the Digital Differential Analyzer algorithm. A ray is cast for every screen column to find the nearest wall, its distance, and the texture slice to draw.

It includes perspective-correct wall textures, floor and ceiling rendering, tile-grid collision detection, in-world sprites, and an overlay minimap showing position and viewing direction.