Basic 3D Engine Design
23 August 2007Ray Casting is a extremely fast method of generating 3D images using high-school level mathematics.
Remember playing Wolfenstein 3-D? This was one of the first games made using the ray casting technique.

The graphics in Wolfenstein don't even come close to today's gaming standards; but it was still impressive for it's time. It was also fast, considering the speed of the hardware it ran on.
Although ray casting is an outdated method, it's a good introduction to 3D imagery and game design. It's also quite easy to recreate yourself (if you can remember pythagoras theorem).
The basic idea of ray casting is very simple. To transform a 2d image map into a 3d representation, "rays" are projected from the viewer towards the light source. If a ray hits an object on the 2d map, a vertical line is drawn on our "3d" image to represent this section of the wall or object. Think of the image as vertical slices.
This diagram might do a better job of explaining.

Textures can be applied using texture maps but unfortunately other effects like reflections aren't so easy to create. They can be faked though.
If you've got nothing to do for a few hours, consider creating a simple ray cay caster in your favourite language.
Here's a few resources to get you started.