3D workflow   15 comments

First, get some data. PDS is the home of the Planetary Data System. LOLA is the home of the Lunar Orbiter Laser Altimeter.  Click on the GDR link and you get a list of files.  Starting on the second page is a list of LDEM files.  They are available in .img and .jp2.  I haven’t found any program to open .img on a microcomputer, so use jp2.  Click on a listing and an information window appears at the right.  Right-click on the filename and select save, or click the “Add to Cart” link.  You can put several files into your cart and have them delivered ftp.  Alternately, you can right-click on a file and download it straightaway.

Once you have a file, you need to read it.  There are free photoshop plug-ins to read JPEG2000 files.  You need to have the plug-in installed and working.  The plug-in expands the file and reads it in to photoshop.  These files can be big. The polar files are stereographic projection, and the full-moon files are cylindrical.  They are 16-bit grayscale.  If you are familar with the moon you will immediately recognize areas in the grayscale image.  Select an area with the clipping tool to begin your work.

To use them with another program, you need to reduce the data density to reduce the amount of work the other program will do to produce 3D.  Image Size does this nicely.  At the resulting scales I haven’t seen any difference between Nearest Neighbor and Bicubic for the method.  I have a 2Gb mac laptop that can work with 800 x 800 image for 3D stereo lithography, or 1200 x 1200 for point clouds.  (Update:  I have an 8Gb machine with an SSD, and have produced 2k x 2k surfaces with it.  That took eight hours.  Saving the surface as six tiles took three hours.)

Save the file as a 16-bit grayscale TIFF.  Mathematica can import tiff files.  A little bit of coding and the imported file can be plotted with ListPlot3D.  The two facts:  the actual heights in meters above the reference radius of the moon is doubled and stored as a 16 bit number in a pixel.  Mathematica reads in grayscale files as a number between 0 and 1.  So multiply the values by 2^15 to get the actual heights.  After you plot in ListPlot3D, Export as an stl for stereo lithography and imaging in meshlab, or obj to save as a point cloud.  My two gigabyte laptop tops out at about 600 x 600 before it runs out of memory.  For larger sizes I use a high performance computer with up to 128 Gb; a 650 meg 2500 x 2500 stl used about 37 Gb to process.

STL files can go directly to a prototyper for 3D printing.

I use Blender now for snapshots and for movies.  The lighting controls are much better than meshlab.

For movies I use Blender 2.5, a free, open-source 3D animation program (the latest version is 2.60 available at http://www.blender.org).  Import the stl file, scale it down to roughly 100 x 100 and move it down in Z until you can see it.  Then you can light it with a Sun lamp and take a snapshot, or skin it with a 2D texture image taken from http://target.lroc.asu.edu/da/qmap.html, which has all the WAC and NAC camera data from LROC.  If you skin the stl, light it with a hemi and animate the camera to make a movie.  Skinning is fussy, fussy, fussy.  The stl has to be properly oriented before the import, and the texture map the right size.  It has been entirely cut and try, but very satisfying when the crater falls into the cup.  I haven’t gotten UV mapping working in this process because of the large file sizes:  it has slowed the computer too much to be responsive.

Blender can work with larger files than meshlab, but you will need 16Gb for files over 500 meg, and be prepared to wait.  There is a few second lag between mouse movements and screen response.  I’ve had success by taking a snapshot of a high-resolution stl at a low sun angle, and using the picture as a 2D texture for a low-resolution stl of the same area.  In this case the orientations and image sizes all line up.  For the South Pole, the results matched the Kaguya-Selene HD video of the same region.

You can reduce the file size in Meshlab before importing your stl file by Removing Duplicated Vertices under Cleaning and Repairing.  Export the mesh as .ply file.  There is a bug in Meshlab that prevents exporting as stl after removing duplicated vertices.  The mesh will export but the duplicated vertices remain.  A 39 meg mesh can be reduced to 14.8 meg.  There are still the same vertex and face counts in the file.  Blender will import .ply files.  These days I export from Mathematica as .ply.  You still have to remove duplicated vertices in Meshlab.

Howard Fink

Posted March 18, 2011 by finkh

15 responses to “3D workflow

Subscribe to comments with RSS.

  1. Hi there,

    Wondering if you can help me out. I am trying to find the greyscale DEM maps to use in my 3D animation software to recreate an accurate surface of the moon. I have tried the link you indicate at the top of your 3D workflow page but am really confused about the GDR link. Not finding it. Any help would be appreciated.

    Many thanks

    Charles

  2. Start here: http://ode.rsl.wustl.edu/moon/
    Click Data Set Browser Tab.
    Click LRO
    Click LOLA
    Click LRO-L-LOLA-4-GDR-V1.0
    Click LROLOL_0XXX
    Click data
    Click lola_gdr
    Choose cylindrical or polar
    Clicking polar, then click jp2
    You have arrived.

  3. You have amazing work here. I was wondering if you can help me out with trying to find some data. I was trying to find some height map data of Shackleton Crater in order to recreate something you’ve got on here. I’m having a hard time trying to navigate the product browser on the LODE website. Is there any way you can help me find some data for Shackleton Crater? Anything would help!

    Thank you!
    Adam

  4. Start here: http://ode.rsl.wustl.edu/moon/
    Click Data Set Browser Tab.
    Click LRO
    Click LOLA
    Click LRO-L-LOLA-16-GDR-V1.0
    Click LROLOL_0XXX
    Click data
    Click lola_gdr
    Choose polar
    Clicking polar, then click jp2
    LDEM are the Digital Elevation Models.

    ldem_875s_5m.jp2 is a five meter per pixel 16 bit grayscale TIFF in stereographic projection. The LDEM files published are roughly the same file size, so there is an ldem_85s_10m.jp2 that covers ten degrees at a lower resolution than the five degree file. The individual pixels need to be mapped onto a sphere, then projected by height. The grayscale value is twice the height, so you must divide by two. More info is in the lbl file.

    The projection math is in a .CAT file that can be found in here: ldem_875s_5m_jp2.lbl. The DSMAP_POLAR.CAT file is a text file which must be opened by a text editor. Do not double-click it.

    You must use a 16-bit graphics editor to change the resolution or crop the image. I used Photoshop.

    • Mr. Fink,

      Thank you for your quick and detailed response. This is exactly what I was looking for! Thank you for your help and keep up the good work on here!

      Best regards,
      Adam Fisher

  5. I’m trying to download LOLA GDR data for the north pole (ldem_85n) on the PDS site mentioned in the first paragraph. I can get to the .img file (in my case “ldem_85n_10m.img”), but can’t find the .jp2 file. Am I missing something obvious? Thanks greatly for any help.

    • It’s not the easiest site to navigate. There is a separate jp2 folder after you choose the polar folder.

      • Thanks, Howard. I was looking in the wrong place. I’ve acquired the .jp2 files and the Photoshop importer, but I’m only getting a flat, gray image. Should I be able to discern differences in this file with the naked eye?

      • choose fit on screen in the view menu. You should see craters. LDEM_85N_40M.jp2 should be the file name. Be sure you have scrolled past the LDEC files.

      • Ah, success! Thanks for your tip below… I was apparently downloaded the LDEC data the first time around.

  6. http://pds.jpl.nasa.gov/
    Click Earth’s Moon
    Click Lunar Reconnaissance Orbiter(26)
    Click Search Tool: Lunar Orbiter Data Explorer under Search Tools at the top.
    Click the Data Set Browser tab at the top.
    Click LRO
    Click LOLA
    Click LRO-L-LOLA-16-GDR-V1.0
    Click LROLOL_0XXX
    Click data
    Click lola_gdr
    Click polar
    Click jp2
    you are in. Be sure to choose ldem, not ldec.
    ldem_85s_20m.jp2

    Right-click on the file and choose save link as: to download.

  7. Can you tell me how to get to a slope map of this area (something like this: http://www.sos.noaa.gov/Datasets/dataset.php?id=383)? Is that type of imagery available from this resource?

    • pds.jpl.nasa.gov GDRDSM Type in LRO LOLA has slope information. They are img files The full moon at 16pixels per degree, and the poles at higher resolutions.

      “Each sample represents the surface slope at a baseline of 240 meters. A scaling was applied to make better use of the 16-bit integer range: a flat surface corresponds to a numerical value of -30,000, and a surface tilted by 45 degrees corresponds to a numerical value of 0.”

  8. I’m looking to study your workflow to create an accurate map which I can use in the unity engine for a game I am working on. I understand how to find my way around the LRO sites and collecting the right information for that area I want mapped but I’m lost in terms of mapping with maths, are there any tutorials for the programs you use that you could link me to. Its been years since the last post on this page in particular, perhaps the workflow is even smoother now, are there any tips or updates that could help?

    One of the areas I am turning into a level is Shackleton Crater, Currently I have been making my own height maps from images I’ve taken and edited from the LRO data but the results are a little sloppy.

    Much thanks.

Leave a comment