Generating a height field in 3D using a 2D image using OpenGL libraries