A simple Raycasting project made in Java using the Processing core library.
There are a couple bugs related to the world rotation of the 1st person camera... oh well. This was a sideproject and it is now abandoned.
Here is a good Wikipedia article about the topic. To summarize, we have a series of rays projected from a point in all directions and onto walls, which then are processed as a function of the distance and angle to give the impression of depth. This project diverges and evolves from the Wikipedia article in that I don't use "cells", I use math to define the walls, so they can have any shape and resolution I want. For example, this code creates a wall of a random size, in a random location and at a random angle:
Wall wall = new Wall(random(width-1), random(height-1), random(width-1), random(height-1));
Download processing from the Processing page and go into the folder where you extracted it. Then, "core > library > core.jar". You will need to add the core.jar into the external libraries of the project. After that, everything will work.