Extract altitude calculation code to function.
There isn't index buffer with size equals one.
Limit mouse zooming.