Digital Elevation Model (DEM) Terrain Displacement

Report this File

Dem_tutorial_18

Views:

128,411

Updated:

Feb 25, 2006

Readership Level:

Advanced

Tags:

Maya Versions:

6.x, 7.x

Platforms:

windows

Owner:

Language:

English

In this tutorial you will learn how to create the image seen below using displacement in Mental Ray for Maya.

click for larger version
Mt. Rainier


To follow along with this tutorial you will need the following software installed on your machine:

* Note: You can use an older version of Photoshop, but you will be limited to 8-bit TIFF file output. With Photoshop CS you can export 16-bit TIFF files for finer displacement.

We are going to be building a digital version of Mount Rainier using satellite digital elevation maps (DEM) and displacement inside of Maya with the Mental Ray plug-in. One key factor to remember while following this tutorial is ORGANIZATION! There will be a LOT of information covered here and you can get lost really quickly. Keeping things like file names and subfolders organized will help you keep things manageable along the way.

DEMs are greyscale photographs taken by satellites in orbit of the Earth capturing terrain elevation values. These DEMs are broken down into approximately 6.5 mile by 7.5 mile sections called quads.

Before we get started you will need to create two (free) accounts to gather the images needed for this project. One account will be at the USGS Quads site which will be used to determine what quads make up the area we will be building. The other account will be at the Geocomm website which is where we will be downloading the quads from. You have the option of setting up a pay account at Geocomm. When you pay for a premium account you get a faster connection speed for downloading. Or you can just use a free account and the downloads will take longer. The typical connection speed is limited to 3-5 KB/sec for the free account. I am not 100% sure if the download speed is based on IP address or your log on account. When I download with several machines, that are behind a single IP address router, the total speed is spread over each download and you can achieve blazing speeds of 0.2 KB/sec. So, I just find it better to let one download have all the bandwidth and find something else to do while you are downloading. The average file size is 2-4 MB usually resulting in around 10 min to download each quad. The other option would be to have Geocomm burn the DEM data to a CD and mail it to you for a fee.

The quads are sorted by county on the Geocomm site so you will also need to locate the county names for your target location. I usually do a search on Google for " county map" and within the first few hits I can find a good image to go with. This is the county map image I found for Washington State.

click for larger version

Sometimes, as with this project, your quads may span two or more counties depending on their location. This is where it's helpful to have a map of what counties butt up next to each other.

After you have your counties image, go to the USGS Quad finder site and under the "1:24k Search" navigate down to Washington in the list and click it.

click for larger version

This is where you will need to have an account created. When you locate the section of quads we will be needing you will find that some of our quads are located in Pierce County and some are in Lewis County.

click for larger version

I've added the red line and county names to our map for illustration. This is where your research skills come into play in determining county lines.
Tutorial_next_page

Comments

Dashboard_avatar
Jan 26, 2010
Post id: 9959
Report this comment to moderators [SPAM]

Hey Im getting an error when I try to load the DEM to get the grayscale image. In the PullSDTS command prompt it says, "AttributeError: 'unicode' object has no attribute 'open'"
Do you have any suggestions to get past this?

Dashboard_avatar
Feb 18, 2010
Post id: 10195
Report this comment to moderators [SPAM]

Same problem here as well..Have tried for quite sometime now to get it to work. Would like some input on how to solve this error.

Thanks :)

Dashboard_avatar
Apr 06, 2010
Post id: 10730
Report this comment to moderators [SPAM]

Im having the same problem here.

Here is the Python Report

Exception in Tkinter callback
Traceback <most last call recent>:
File "C:\Python26\lib\lib-tk\Tlinter.py", line 1410, in __call__
return self.func<*args>
File "C:\Users\Horza\Downloads\pullsdts\pullsdts.py@, line 395, in demview
xfer.getSpecial<'CEL0',w>
File "C:\Users\Horza\Downloads\pullsdts\sdts.py@, line 1419, in get Special
retval = demSpeedReader<fn> \fast kludge
File "C:\Users\Horza\Downloads\pullsdts\sdts.py@, line 354, in demSpeedReader
f.open<'r'>
AttributeErroe 'unicode' object has no attribute 'open'

Ive never used python before and I downloaded it for this tutorial. I also went about the hard way of finding out the Ne Sw statistics as I wanted to learn how to do this the real way instead of using the stats you provided.

Suffice to say, I was a little disappointed when I failed at the next stage : (

Any help greatly received. : )

View morph106 's profile
Jun 08, 2010
Post id: 11430
Report this comment to moderators [SPAM]

Can anyone enlighten me as to why my nurbs plane comes out looking like a staccato mess of a mesh?
http://forums.cgsociety.org/showthread.php?f=87&t=890059

Dashboard_avatar
Sep 14, 2010
Post id: 12444
Report this comment to moderators [SPAM]

I had the same problem with pullSDTS, but got it working by opening the tarball (gz) files in it instead of unpacking them with another program. See the documentation for pullSDTS.

View Stefano Cieri's profile
Mar 21, 2011
Post id: 14110
Report this comment to moderators [SPAM]

I bounced into a couple of the above problems, too. For those who still didn't find a solution:

when the error you get is in loading the DEM infos (from the tar.gz file), my workaround was to pre-unpack the files with 7zip (I'm not sure if it's what Thom Falter suggested, or the opposite; in my case it worked, anyway)
I then filtered the .ddf files with pullSDTS's option "SDTS transfer *iden.ddf" and selected the only available one.

when the error is in loading the DEM image, instead, and you get the message some reported above:
AttributeError: 'unicode' object has no attribute 'open'
what I did to solve (no idea how clean the trick is) is changing line 350 in sdts.py from:
if type(celFile) == type('string'):
to:
if isinstance(celFile, (str, unicode)):

Hope that helps,
s

Dashboard_avatar
Oct 25, 2011
Post id: 15409
Report this comment to moderators [SPAM]

@Stefano Cieri You Brilliant SOB! It worked! I can't thank you enough. Also, the sole reason I opened an account here was so I could thank you. Thanks again!

Dashboard_avatar
Oct 27, 2011
Post id: 15417
Report this comment to moderators [SPAM]

Does any one know if it's possible to get the nurbs mesh to match the displacement map?

Dashboard_avatar
Nov 13, 2011
Post id: 15486
Report this comment to moderators [SPAM]

So, I came across a way to generate a mesh of the surface using photoshop. Once you have the image in photoshop go to 3D> mesh> plane. scale the y accordingly. Then go to 3d> export> obj. Import the Obj in Maya and you'll have a surface.

Write a Comment

You must be logged in and have verified your email address to leave a comment. Login or create an account