Rotating ASCII globe with simple lighting, in C.
A small, self-contained demo written in pure C — no external libraries, just the standard library and POSIX. Part of the Corg-Labs collection of single-file C programs.
- Sphere surface points are generated from spherical coordinates
- Each point is rotated around the vertical axis per frame
- A z-buffer keeps only the nearest point per cell
- A dot product with a light direction picks the shade character
gcc globe.c -o globe -lm
./globe
Press Ctrl-C to quit.