Render surface polygon with terrain data

hi ,how to render the triangular patches of surface polygon with terrain data ,and each triangular patches’s color is depends on terain height. like this app : https://www.propelleraero.com/