Raytraced height maps

(version française)

While browsing the (numerous) websites about POV-Ray, I came across Christoph's page, featuring a render of the Hawaii island out of satellit data (radar height detection).

I thought I could experiment a bit with maps of my neighbourhood (around Bordeaux). As the original page is short on details, and that others could be interested in rendering other maps, here are the results of my searches...

Fetching maps

Bordeaux is easy to locate, 45°N, 1°W (roughly). Hence I fetched the following maps:

File format is documented: height is stored as signed 16 bits integers, big-endian. Above SRTM-3 files contain 1201x1201 samples, maps overlapping with the next on their last sample.

Format conversion

Favorite POV-Ray primitive for that kind of object is the height_field, that requires a bitmap (16 bits recommended), to get its pixels' heights.

asc2tga generates TGA for that task. With asc2tga sources, I wrote a filter (two in fact) to read zipped SRTM-3, merge them, and write a 16 bits TGA file that matches POV-Ray requirements:

Those filters aren't parametrized (sweet lazyness...), but main steps are controlled by the end of the code, it should be easy to modify them to match your needs.

Raytracing

Hardest step is over. Just write a correct POV file, and that's it:

Enjoy!

petchema at concept-micro dot com