This is an implementation of an old rendering technique called voxel space rendering commonly used in the 1990's
The math
We are given a height and color map, call it and . Where is the point on the map to be sampled. Suppose the camera is at some point , with height . Voxel space rendering works by scanning the view frustum in a back to front order, for each point on the frustum, we calculate the height of the rasterized point with the formula,
Where is the height of the point relative to the camera, and is a scaling term used to perform perspective projection. We can adjust the pitch of the camera by adding an offset term, to the formula,
Effectively translating the image by a fixed value. We draw a vertical line from the bottom of the rasterized image to the calculated height with the sampled color .