1. Using MicroDEM 8.0, open the DEM file.
2. Click menu item "Info" and note the min. and max. elevations.
3. File - Save DEM - ASCII XYZ (choose a name and location to save to).
4. Ascii Export Options [choose XY Format = "UTM" and Z format = "Meters (float)". Click OK and wait while it writes the XYZ file].
5. Now using HOG, choose Tools - Convert - "ASCII XYZ to 24-bit height map".....wait while Piglet does it's thing.
6. Open the resulting psychedelic 24-bit TGA using a graphics utility (I used IrfanView).
7. Crop the image to dimensions fitting this equation;
Width (or height) in pixels = (N x 72) + 4 (where N = number of trainz baseboards).
Before cropping, you can apparently resize the TGA without damaging the data. I resized the image keeping the width to height ratio constant. I did this without resampling the image. At this stage, I don't know if resampling or changing the aspect ratio does any harm to a 24-bit height coded map.
8. Put the image in the HOG folder.
9. Open HOG again, feed in the 24-bit TGA as the elevation map and enter the min. and max. elevations noted in MicroDEM. For the record, I did not click "interpolate" at this stage. This method doesn't seem to need it.
10. Create the trainz gnd file as per normal in HOG.
One odd thing I did notice was that max and min elevations used as input via HOG were not reflected numerically in the Trainz terrain. I had to re-do steps 8 - 9, trying different elevation ranges until it came out how I wanted. Not sure what's going on with that. However the main thing is there are no "rice paddies" up the hillsides! Thanks to all contributors to this thread, I would never have figured it out without your help.
- Deane
____________________________
Deane,
You don't need to enter the elevation range as the actual height data is taken directly from the ascii dem and encoded into the 24-bit tga. AFAIK just accept what HOG displays unless you need to scale the heights for some reason.
Grey and chroma scales don't encode the actual height only a scaled value so you have to tell HOG what range to use.
Bob Pearson
PS. Image looks good. Note resizing will change the horizontal scale as the tga piglet makes is sized at 1 pixel = 10 m. I would just crop it to get the area and aspect ratio you want. Tiger or other type of vector overlays can be created in MD the same way as previous using the DEM you made the ascii xyz from. Layer them over the 24-bit height encoded tga in the paint program of choice and crop to size when you do the height file so they will align in HOG.
PPS. Interpolation option will give a smoother look to the terrain even if you start with 10m DEM. May or may not be what you're trying to achieve. For DEMS with less resolution I think I'd perfer to let MD do the interpolation by resampling on a 10m x 10m utm grid 1st since the data has to be interpolated anyhow. Personal preference to some extent but my 2 cents worth.
___________________________________
Ah, well that explains it, thanks again Bob.
It seems to me that this "Ascii-XYZ-Piglet" method is actually simpler, less error-prone and gives superior results to the Chroma color method. I like it. Less chance of getting "illegal" colored pixels (even if you resize the image) and the elevation range takes care of itself if you don't want to change from it's original value.
For those who have never seen one before, the 24-bit height coded TGA made by Piglet is very different from Chroma and Greyscale images. Here is a sample, so you'll recognize it;
I did actually try the "interpolation" option at the HOG stage, but found the final terrain lost some of it's sharpness. On the other hand, it didn't do any real damage, so it seems to be a choice rather than a mandatory yes or no.
Thanks also for mentioning how to include vector data Bob. I skipped it because in this case, I intend to totally change the look of the land (imagine Oregon after 200 years of global warming has transformed it into a desert!).
Regarding resizing, yes, you would normally only need to crop. In my case, I wanted to capture all the nice topology but not end up with too big a Trainz map. I reduced the X-Y dimensions of the image by half (reduces area and filesize to one-quarter). Having done that, I also needed to reduce the Z (elevation) range by a similar factor to keep gradients the same. This seems to require some trial and error. If you are not changing elevation range, leave HOG at its default values (-1000m and +9000m) before making the gnd file.
OK, now I only have 1254 baseboards to texture.