Orthoimage & Image Shader

Started by oliverz3d, September 06, 2009, 01:32:18 AM

Previous topic - Next topic

oliverz3d

I just started exploring Terragen 2 and acquired a geoTIFF of a small area in Arizona via USGS Seamless Server along with the orthoimage to use as a guide (road, etc.). Now I have been able to finally apply the orthoimage correctly to the terrain, but I'm not 100% clear why I had to input some values for a specific setting. I'm probably just a bit daft at the moment, but I'd appreciate if someone can clear this up.

I recorded the NW & SE Lat/Long values provided with the geoTiff that was exported from the USGS Seamless Server and calculated the center/midpoint. (Had some issues otherwise apply the image map correctly, centering the values made sense).
That central midpoint was defined as the lat long at apex. From what I understand, this shifts the position of lat/long of the locale to the 'planet's' apex, Terragen's starting point.

Next. Heightfield Load File and select the GeoTiff, which imports with georeference and auto georeference from file. The georeference values are correct.

Then  goto the Heightfield shader and position center to match my use of center/midpoint.

Now goto Shaders, Add Layer > Colour Shader > Image Map Shader and load the matching orthoimage file. I determine the size by loading the image into Terragen Classic and checking the size. Unfortunately the image is not entirely square as the USGS tools doesn't allow for a proper square selection, but this gives me one accurate axis value in meters. I then calculate the ratio via the orthoimage resolution to determine the size on the other axis. Insert those values into the Image Map Size. Select Position Center and Plan Y for the projection type. Now considering the georeferenced terrain is at the planet apex (position 0, 0, 0) I don't touch the image position values.

Now at first everything appeared correct, until I realized that the road was not quite aligned properly with the key geographical features. I then went to move the position and realized that the inverse lat/long values used for the planet apex setting, placed the orthoimage in the correct position. That led me to revert the image shader position back to 0, 0, 0 and insert the lag/long planet apex value into the heightfield shader position with the same desired effect. So I corrected the problem in two different ways.

Why this worked and was necessary doesn't quite make sense. Especially as the lat/long settings are not the same as metric positioning.


Matt

#1
The lat-long values are different from the metric positioning in the heightfield shader and the image map shader, as you said. I think it may just be coincidence that entering the lat-long values into one of the shader's position parameters made them align better.

When the heightfield node has georeferencing data, "position centre", "position lower left" and "position upper left" options are ignored, but the position parameter can still be used as an offset. It should therefore be 0,0 if you set your planet's apex to be the midpoint of your heightfield's lat-long and your ortho image is also centred on 0,0,0.

When you first loaded the heightfield and set it up as you describe (before loading the matching orthoimage), did the heightfield centre appear to be at the origin?

There is another complication. The lat-long projection may pinch the heightfield at the northern or southern edge, whereas the image map shader can't pinch the projection in the same way.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

oliverz3d

Thanks Matt, I guess those values were coincidental. Taking a closer look, the heightfield centre was not actually at the origin, close to it, but that accounts for the ortho image being initially offset.