Skip to content
/ FdF Public

Software-rendered 3D terrain visualizer in C.

Notifications You must be signed in to change notification settings

cpireyre/FdF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wireframe Renderer

3D wireframe terrain renderer from scratch in C, using 1990s graphics programming techniques.

The program takes a height map and renders it as an interactive rotatable 3D wireframe. Everything implemented by me: Bresenham line algorithm, z-buffering, and Cohen-Sutherland clipping. Interestingly, it can work almost out of the box with topographic data such as from the National Land Survey of Finland.

FdF wireframe rendering of Helsinki harbor area showing elevation data as a 3D mesh

Apple Maps view of the same Helsinki harbor area for comparison, showing Kalasatama, Mustikkamaa island, and the surrounding waterways

FdF rendering from elevation data Corresponding area in Apple Maps

Implementation details and further thoughts

No GPU, no shaders, basically only dependent on the primitive 42 interface to GLFW. I used the arena allocator from David Hanson's C Interfaces and Implementations to great effect. Thank you David! Thank you as well to Michael Abrash for pioneering many of these high-performance software rendering techniques, and, equally importantly, documenting them clearly for posterity in his Graphics Programming Black Book. Were I to work on this further, I'd love to improve the performance and rendering quality. Implementing Wu Antialiasing would be the obvious next step. I'd also be curious to go in a wildly different direction and rewrite the whole thing for the GPU with e.g. GLSL and see how different that is.

FdF interactive 3D wireframe rotation demo

About

Software-rendered 3D terrain visualizer in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published