Aimane.OS
← Back to Portfolio
PROJECT CASE STUDY // 3D RAYCASTING ENGINE

cub3D Raycasting Engine

Rendering a pseudo-3D world in real-time — from C to TypeScript

LIVE DEMO — CLICK CANVAS TO PLAYPure TypeScript DDA Engine
LOADING CUB3D RAYCASTING ENGINE...

DDA Mathematics

Digital Differential Analysis algorithm for precise ray-wall intersection checks — O(1) per ray, no ray-stepping loops. Casts one ray per screen column for real-time column slicing.

Zero-Allocation Rasterizer

32-bit ArrayBuffer blitting with 0ms GC pauses. No object allocation inside the render loop — pre-allocated frame buffers reused across frames.

60+ FPS Software Rendering

No GPU hardware acceleration required. Pure Canvas 2D software rasterization achieving consistent 60 FPS — same DDA algorithm ported from C to TypeScript with zero allocation overhead.

The Story: From C to TypeScript

Built a real-time raycasting engine in C at 1337 School (42 Network). Reimplemented the same DDA algorithm in zero-allocation TypeScript — running at 60+ FPS in software, entirely in the browser. This port demonstrates that deep systems knowledge transfers directly to modern web engineering: understanding memory layout and algorithm efficiency matters everywhere.