Ancient Web: Lode Explained Wolfenstein-Style Walls in C++

Lode Vandevenne's mid-2000s raycasting tutorial preserves source code, diagrams, and the mathematics behind a classic first-person game rendering technique.

Part of the Ancient Web Collection.

A wall in an early first-person game might be no more than a vertical strip of pixels. The interesting part is how the computer decides which strip to draw.

Read Lode's raycasting tutorial.

Lode Vandevenne's Computer Graphics Tutorial is an old-school engineering resource: a long explanation, diagrams, and complete C++ examples that readers can download and study. Its project index dates revisions to 2007, and the site's copyright line begins in 2004. Later corrections extend into 2019, so this is a maintained historical tutorial rather than an untouched original.

The raycasting lesson starts by describing the appeal of a trick used for Wolfenstein 3D: build a convincing corridor view from a two-dimensional grid of wall squares without calculating a fully three-dimensional world.

Every column gets a ray

The method sends a ray from the player's position through each vertical column of the view. When the ray strikes a grid wall, the program calculates how tall that wall should look at the measured distance. Nearby surfaces get tall strips; distant ones get short strips.

The author explains why checking every tiny interval along the ray would be inefficient. Instead, a Digital Differential Analysis method, or DDA, moves directly between grid boundaries until it reaches a wall. Diagrams show the difference between a naive stepping method and the more reliable boundary-crossing approach.

The tutorial is not just an outline. It provides a sample map, the player's position and viewing direction, rotation math, collision detection, textured and untextured renderers, and code for calculating frame timing.

The larger graphics tutorial index offers chapters on lighting, flood fill, plasma and fire effects, Fourier transforms, and more advanced raycasting with sprites, floors, and ceilings. The site also provides the QuickCG helper library used by its examples.

Its value to Web history lies in the method of teaching: full source code and all the reasoning are on the page. Nothing requires a paid course, embedded video, or login. The details belong to a specific C++ and SDL-era environment; modern compilers may need adjustments.

Explore the full raycasting lesson and related graphics chapters.

Part of the Ancient Web Collection.

Articles RSS