Cub_3d
Cub3D is a graphics programming project inspired by the classic game Wolfenstein 3D. It consists of building a simple 3D engine in C using ray-casting techniques.
The program renders a first-person view of a maze generated from a 2D map. By casting rays from the player’s perspective and detecting wall intersections, it creates a pseudo-3D environment that the user can explore.
The engine is built without a traditional game engine and relies on the MiniLibX graphics library, focusing on low-level rendering, mathematics, and memory management.

Challenge
One of the main challenges was building a real-time rendering engine using only C and a minimal graphics library.
This involved implementing a ray-casting algorithm to simulate 3D depth from a 2D map, parsing and validating .cub configuration files, and performing precise mathematical calculations for angles, distances, and projections. Additional challenges included handling performance constraints and implementing player movement, collision detection, and camera rotation.
The project required a strong understanding of computer graphics fundamentals, trigonometry, and memory management.
Solution
To solve these challenges, the engine was built around a ray-casting rendering pipeline. Rays are projected from the player’s viewpoint across the field of view; when a ray hits a wall in the 2D map, the distance determines the height of the wall slice rendered on screen, creating a pseudo-3D effect.
The architecture includes several core components:
Map Parser – Reads
.cubfiles and validates textures, colors, and map structure.Rendering Engine – Implements the ray-casting algorithm and draws textured walls.
Player System – Handles movement, rotation, and collision detection.
Texture Mapping – Applies textures based on the wall surface hit by each ray.
Input System – Processes keyboard input for player navigation.
All rendering calculations are implemented manually in C, providing full control over the graphics pipeline.
Deliverables

The final project includes:
A fully functional 3D maze exploration program
A custom ray-casting rendering engine
A map parser capable of validating
.cubconfiguration filesTexture mapping and colored floor/ceiling rendering
Player movement and camera rotation controls
Support for multiple textures and map layouts
The project demonstrates how a complete interactive graphical application can be built from scratch using only C and basic graphics libraries.
Impact
This project provided a deep understanding of how early 3D games were built and how modern graphics pipelines evolved.
Through this implementation, I gained experience in:
Low-level graphics programming
Mathematical modeling in computer graphics
Real-time rendering techniques
Game engine architecture
Performance optimization in C
Building a ray-casting engine from scratch strengthened my ability to design complex systems while working within strict technical constraints.
More work
2019 - 2025
A showcase of digital products I’ve crafted for SaaS, FinTech, and startup teams.


