Skip to content

Acors24/cpp-hgt-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Height map viewer

This program can be used to visualize height maps downloaded e.g. from this site.

Tested with clang++ 18.1.6.

Building

Run

make

To clean:

make clean

Usage

./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.

Controls

The map starts in 2D mode. Switch between 2D and 3D with Tab.

2D

  • Mouse up/down/left/right - move north/south/west/east
  • Mouse wheel up/down - zoom in/out
  • Shift - move slower

3D

  • 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.

Screenshots

Screenshot_1 Screenshot_2 Screenshot_3 Screenshot_4 Screenshot_5 Screenshot_6 Screenshot_7

About

Height map viewer written in C++ with OpenGL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published