3D Representation of Contour Maps

Using OpenGL and OpenCV

If an image is too small to view, right click and select 'view image' or 'open image in new tab'.

Input

Ambient Output

Diffuse Output

Gradient Output


Input

Ambient Output

Diffuse Output

Gradient Output


Input

Ambient Output

Diffuse Output

Gradient Output


Wire Frame of Hillside

For every pixel on a contour line, two vertices are made at differing heights. Along with their adjacent vertices, these can be used to create a continuous face across the contour line.

While having two vertices for each pixel on a contour line is very inefficient, it is much easier to implement.

Wire Frame of Hilltop

The lines in the middle of the hilltop consist of center points calculated from the distances of hill edges. As there is one center point calculated for every two horizontal points, a hilltop can be stitched together by creating a face between vertices to the left and right of the center point and the vertices immediately adjacent to them.