Wow it's been 6 months and I just now looked up this thread again.. didn't have time to look at stuff much due to work duties =)
I actually borrowed a few functions from GridMap code to try loading heightmaps in my own code (don't worry, nobody will ever see it but me =p)
I went through the code and other than not understanding the math, I totally get it indeed now.. great stuff..
I was banging my head against a wall for awhile trying to figure out why the return values were so messed up... and then realized.. i'm exporting terrain models from 4.2.2 with machinimastudio, but the maps are from 3.x! Cataclysm has wrought changes on the height maps as well Around echo isles was totally messed up.. so well, i knew Mulgore hasn't changed too much, so I used kalimdor 32_35 -- it's mostly correct but still seems weird so apparently it's changed a little bit as well..
i wonder, if it's possible to create .map files from the current client? the available ad.exe is of course for running with the supported 3.x client...
or else i'd need a way to export terrain from the 3.x client... seems the extractor would be easier to find a version of though..?
sorry if this is a bit off-topic.. you guys are just the most knowledgable in the world in this area outside Blizzard