Most introductions to computer graphics begin with triangular meshes and a graphics API — a steep entry cost even for legacy APIs like OpenGL, and steeper still for modern ones. This demo is intended for those with no prior graphics experience who want to understand 3D surface rendering without that overhead. We illustrate the core principles through direct manipulation of real geospatial data.
Most graphics courses build rendering on top of triangular meshes, but the
lighting model itself requires only a surface normal. A digital elevation model
(DEM) supplies normals directly, bypassing mesh construction entirely. As a
single-valued height function
We implement Phong shading from scratch in Python over a real LiDAR DEM (Illinois statewide survey). An interactive widget exposes the shading parameters — light direction, ambient, diffuse, specular coefficients — so the reader can feel the effect of each before its formula is introduced.
Problem. The DEM is a discrete grid; the surface normal at each point must be approximated.
Model. A height map
The surface normal is their cross product:
Algorithm. Approximating the partial derivatives by central finite differences: