three.js is quite well suited to things like terrain generation. There's actually an example in the official docs - https://threejs.org/examples/webgl_terrain_dynamic.html - it wouldn't take much effort to swap out the noise generator for a heightmap.