If you want to raytrace your favorite canyon or mountain with POV-Ray, you have to get the digitized data that represent the landscape. This is easy, if this landscape is located in the United States of America, because the elevation data for every of the US states including Alaska and Hawai'i are available on the WWW-server of the US Geological Survey. To raytrace a picture from these data, you have to do three steps:
STEP I : Find the appropriate file in the database
and download it to your computer
To make it easier for you (and for me as well), I have written this description. If you find something that is wrong or difficult to understand, please send me a mail, and I will try to improve it.
Let me describe STEP III at first, because it is the easiest:
STEP III: raytrace this picture:
The color map in my source is not really "scientific", but just chosen to make the picture more colorful.
You probably would like to trace another picture, so here is one more little POV-Ray source (canyon.pov). It should render the picture below, using the same grandcan.gif as in the upper picture:
If you want to raytrace a different landscape from somewhere else in the United States, you have to find the data on the server of the US Geological Survey. That is a bit more complicated, but it is the first step one normally has to do.
STEP I : Download the data from the WWW-Server of US Geological Survey. In fact, USGS keeps data of almost any place in the US including Alaska and Hawai'i, and the database is really huge. The numbers that represent a landscape are called a Digital Elevation Model. Keep the three letters DEM in mind. You will get lost in the database, if you don't know what you are looking for.
To find your way, choose http://www.usgs.gov, then click "mapping" on the homepage, and you will be on the "National Mapping Page". Look for "Downloadable Data" and click "US GeoData". You will see "1:250,000-scale DEM Data", and there you can chose between three possibilities for download: FTP via Alphabetical list, FTP via State and FTP via Graphics. A "search via state", where you can search for "Arizona", or "via Graphics", where you get a clickable map, will probably be the easiest way to get along.
After having made your choice, you should have a 1:250 000 DEM data file ready for download. The uncompressed versions have a size of about 9 MB. If that is too big, chose the compressed file.
(I chose to download the uncompressed data for Grand Canyon East, but nevertheless, it had the extension .gz, and that confused me a bit, but with an text editor I could immediately check that the data were not compressed.)
Now that you have the DEM data in some directory on your computer, you need to convert them to a heightfield. You need an appropriate software for that step.
STEP II: Download a conversion software and convert the data
If a .gif-heightfield is accurate enough for your purpose,
you have little work to do:
On the Public Domain Software page you will soon see a link to "USGS DEM to TGA Converter", where you can download a .zip-file that contains the C-source and the 92 kB dem2tga.exe file. Run it, and it converts the DEM data to a .tga-file. Though it has the extension .tga now, however, it is not possible to use this file as a POV-Ray heightfield. In a .tga heightfield POV-Ray uses the red and green color values of a pixel to encode the elevation, while this converter produces a "greyscale" .tga file. In this "greyscale" file the different colors of a pixel have the same value. But you can use one of the common graphics programs to open this .tga file and simply store it as a .gif file. You can raytrace that .gif file with POV-Ray immediately. To get correct views, you should mirror the .gif-file and compare your picture with a map to get the correct orientation.
The resolution is not so good as in the original DEM data, because the .gif has only 256 different values for the elevation. It looks somewhat better, if you add the "smooth" keyword to the height_field statement.
Option II: Using a .tga heightfield:
Bright Angel Trail
We hiked down into Grand Canyon on the Bright Angel Trail in 1986. So I tried to render a picture which I could compare with a photo that I took during the hike, just to see the limits of the data. I had to move the POV-Ray camera very carefully to the place where we stood more than ten years ago:
You may need a while to see the corresponding features in the two pictures, but I think the results are not so bad. Only a very small part of the whole .tga file appears in the picture. Unfortunately the Bright Angel Trail starts near the corner of the .tga heightfield, and thus some of the mountains are missing in the right background of the raytraced picture. I should improve the color_map and download the adjacent DEM-data some day...
Bye for now, I hope you will have fun rendering landscapes, and if you detect any ground squirrels in your pictures, don't feed them.