Visualize Your First DEM

Start with the same Mount Rainier scene that powers the gallery. Keep the control loop small in Python, then use the gallery-backed example script when you want the polished render shown at the end of the page.

Minimal API loop

import forge3d as f3d

dem_path = f3d.fetch_dem("rainier")

with f3d.open_viewer_async(
    terrain_path=dem_path,
    width=1440,
    height=900,
) as viewer:
    viewer.set_z_scale(0.1)
    viewer.set_orbit_camera(phi_deg=28, theta_deg=49, radius=5400, fov_deg=42)
    viewer.set_sun(azimuth_deg=302, elevation_deg=24)
    viewer.snapshot("rainier-first-look.png", width=1440, height=900)

What matters

  • fetch_dem() keeps the tutorial stable across source checkouts and installs.

  • ViewerHandle.set_z_scale() matters for real DEMs; the default terrain viewer exaggeration is too aggressive for Rainier.

  • The published image below is the gallery asset from Mount Rainier, generated by scripts/regenerate_gallery.py.

Next: Drape Overlays On Terrain

Expected output

Expected output for the first DEM tutorial