This program can be used to visualize height maps downloaded e.g. from this site.
Tested with clang++ 18.1.6.
Run
make
To clean:
make clean
./main <path/to/hgt/files>... [-lon <x1> <x2>] [-lat <y1> <y2>] [-start <lon> <lat> <alt>]
You must specify at least one path, which could contain directly the .hgt
files or directories containing them, etc.
Coordinates are given in degrees.
-lon
and-lat
specify the range of the loaded tiles, out of the ones in the specified directory.-start
specifies the starting position of the camera.
Altitude is given in kilometers above sea level.
The order of the arguments does not matter.
The program will recursively look for .hgt
files in the given directories, matching any given limits (-lat
/-lon
, if given), and load their data, assuming each of the files contains 1201 * 1201 encoded integers.
Tiles will be loaded asynchronously on a separate thread.
After successful initialization:
- the crosshair should be visible,
- drawing rate, FPS and current 2D coordinates should be printed in the terminal.
The map starts in 2D mode. Switch between 2D and 3D with Tab.
- Mouse up/down/left/right - move north/south/west/east
- Mouse wheel up/down - zoom in/out
- Shift - move slower
- W/S/A/D - move forward/backward/left/right
- Mouse - look around
- Mouse wheel up/down - zoom in/out (FOV)
- Ctrl/Space - descend/ascend
- Shift:
- move faster
- look around slower
The level of detail (LOD) can be changed with the number keys:
- 1 - Native
- 2
- ...
- 7
- 8 - Worst
- 0 - Auto (will adjust each tile's LOD based on distance)
Press Q to recompile shaders for the crosshair, grid and tiles.