Draw ceiling and floor as we compute the distance
Draw ceiling and floor as we compute the distance

Now the very ray casting algorithm is responsible for drawing the floor
and ceiling, and the steps are carefully chosen as to draw the correct
floor/ceiling textures.

This is possible by taking the derivative of the distance in respect to
the screen position. Thank you Wolfram Alpha.

boppreh/room