DEM -> Displacement Map -> .XYZ -> (finally) Maya

DEM -> Displacement Map -> .XYZ -> (finally) Maya

As you–my imaginary audience (because I have no followers)–may know, I’ve been trying to map the area around Bagram Airfield for the sake of remembering a beautiful memory. It’s also to supplement my novel-to-be. I’ve hit a few snags along the way, and I’ll document what I’ve been doing so far.

First, I used Global Mapper to capture the hi-res satellite imagery. I enjoyed the colors/continuity of one particular zoom (as you zoom in closer, the tiling becomes ever-apparent), but required the details. A picture will show this better than I can explain:

The bottom part, where the coloring is consistent, is the more zoomed out tiling, which has a consistent color, but less detail (things become pixelated when you zoom in). The top part, where there appear to be many tiles, is the more detailed zoom, where you can see individual houses; however, the coloring is off (due to the varied time the tiles were taken, as well as the weather conditions at the time).

Well, I found the best solution was to create a blend of the two images to bring out the details while maintaining a consistent color. This is what I got:

SAT_CombinedAs you can see, there’s consistent color with detail.

So, we have the color, but how do we get an accurate 3d model? This is where I ran into some hiccups.

First, I tried using Digital Elevation Models through 1 arc resolution data from USGS found here:

This is what you get: DEM5

Now, this imports beautifully into Global Mapper, as it is a tool made for accurately depicting this type of data. It does some guess work as to how the terrain would react despite the limitations of basically having 256 levels of elevation (8-bit grayscale offers 256 shades of gray from black to white). It does a good job of it.

However, in Maya, this becomes an issue if you’re trying to use this image as a displacement map. With just 5 or 6 Catmull-Clark iterations, it doesn’t look too bad. However, with around 10, the limited levels of elevation become apparent, as seen here:

stepsThose mountains look pretty good. In fact, I need 8 to 10 passes of catclark to give them the detail I desire. However, the subtle incline at the foothill doesn’t look good. It’s stepped.

I tried various other settings to no effect. Then an idea hit me. I could use Global Mapper’s more accurate interpretation of the grayscale DEM and export that data into an .XYZ format (text file with many XYZ coordinates creating a cloud of points). That way, I can get the more precise heights along with the approximated heights of the points lost between the pixels of the grayscale DEM. In order to export correctly from Global Mapper, you need to set the map’s projection to UTM (found under Configuration –> Projection).

From there, I used MeshLab to import the XYZ coordinates, and then went to “Filters -> Normals* -> Computer normals for point sets” to normalize the vertices, and then used “Filters -> Remeshing* -> Screened Poisson Surface Reconstruction” to connect the vertices to create a mesh with faces. Result seen here:PoissonMesh

I’ll take a pause here and continue this in Part 2.