Re: Building Mars Terrain

"Phil Cazzola" <[email protected]> Sat, 19 Feb 2005 12:34:13 -0700
Newsgroups gmane.games.flightgear.terragear.devel
Message-ID <001001c516b9$fef55920$0200a8c0@pc1>
I jumped to the wrong conclusion here.  3Dem wasn't the problem.


The issue was that TerraGear required that the DEM spacing be an
   integer number of arcseconds.  It was rounding down the 28.125 and
   leaving gaps at the edge.  I was able to make some changes
   to process the data.

These changes use a float for the column and row size.
   The change to demchop is to output a float.  The
   change to terrafit.py is to read a float.
For the result to come out looking good, I believe the col and row step
  size still need to be a factor of 450 arcseconds (1/8 degrees), i.e.
  an integer number of  columns = 1/8 degree.  Luckily
  for me, the data I'm using is 28.125 arcseconds or 1/128 of a degree.
  The result is 16 intervals per 1/8 degree instead of 15 for DEM-30 data.


Feel free to incorpate or pitch.

Phil Cazzola



Index: DEM/dem.cxx
===================================================================
RCS file: /var/cvs/TerraGear-0.0/TerraGear/src/Lib/DEM/dem.cxx,v
retrieving revision 1.20
diff -r1.20 dem.cxx
477,478c477,478
<     fprintf( fp, "%d %d %d %d\n", span_x + 1, (int)col_step,
<            span_y + 1, (int)row_step );
---
>     fprintf( fp, "%d %f %d %f\n", span_x + 1, col_step,
>            span_y + 1, row_step );



Index: TerraFit/terrafit.py
===================================================================
RCS file: /var/cvs/TerraGear-0.0/TerraGear/src/Prep/TerraFit/terrafit.py,v
retrieving revision 1.9
diff -r1.9 terrafit.py
101a102
>     from string import atof
127c128,131
<     span_x,step_x,span_y,step_y = map(atoi,data.split()[:4])
---
>
>     span_x,step_x,span_y,step_y = map(atof,data.split()[:4])
>     span_x = int(span_x)
>     span_y = int(span_y)
134c138
<     print "step_x %d, step_y %d"%(step_x, step_y)
---
>     print "step_x %f, step_y %f"%(step_x, step_y)




  ----- Original Message ----- 
  From: Phil Cazzola 
  To: TerraGear developers discussions 
  Sent: Thursday, February 17, 2005 10:59 AM
  Subject: Re: [Terragear-devel] Building Mars Terrain



  I thinkI tracked down my problem and in was in 3Dem and not in the use any of the TerraGear tools.
  It looks like if you view the MOLA data in 3Dem w/ the lat/lon grid on and save it to a 
     DEM file it saves the grid in the file (yikes).

  I'm reprocessing a new section.  I will probably post the results later.

  Phil Cazzola

    ----- Original Message ----- 
    From: Phil Cazzola 
    To: [email protected] 
    Sent: Wednesday, February 16, 2005 3:25 AM
    Subject: [Terragear-devel] Building Mars Terrain




    I've been trying to build Martian terrain using TerraGear and could you a little advice.
    Please excuse my nubeness....


    Here is what I've done so far.

    Downloaded and built FlightGear, TerraGear, etc.   I'm running 
        cygwin on WinXP.  It wasn't 'straight out of the box', but
        I used the mailing archive to fix the problems that others
        had already discovered.

    Applied the changes suggested by
    http://seneca.me.umn.edu/pipermail/flightgear-devel/2002-March/005377.html


    Downloaded a MOLA (Mars Laser Altimeter) MEGT file.  These files with
      elevations at  1/128 degree intervals.  The heights are specified like
      and altitude.

    Using 3Dem (http://www.visualizationsoftware.com/3dem.html) I converted these
      to USGS Ascii DEM files.

    Used DemChop to split these into directories that TerraGear wants for DEM-30.
       I had to modify DemChop to handle a larger Dem file (3840 records).
       
    Ran TerraFit.py on the whole mess.


    I tried to create an "everywhere" land mass by using tguserdef.  I defined
       a big polygon w/ default texture and ran this over a 10 deg by 10 deg
       section.

    ========= start of file =========
    <?xml version="1.0"?>

    <PropertyList>

      <polygon>
        <name> Mars Ground</name>
        <material>Default</material>
        <contour>
         <hole>false</hole>
         <v>
          -179.99 -89.99
          -179.99 89.99
          179.99 89.99
          179.99 -89.99
         </v>
        </contour>
      </polygon>
    </PropertyList>
    ========= end of file =========

    I ran fgfs-tools-*  on DEM-30 LandMass and it generated a scenery directory.
    When I use this w/ FlightGear w/ debug on I see 

      Skipping bad material entry params
      Tile not found (Ok if initializing)
      Tile not found (Ok if initializing)
      Failed to remove nav-vor-ident sound
      Failed to remove nav-vor-ident sound
      Failed to remove nav-vor-ident sound
      Failed to remove nav-vor-ident sound
      FaiFailed to remove nav-vor-ident sound


    Depending on the lat/lon I select, it might freeze on loading.  When it doesn't, the
        terrain doesn't look so hot.  There are steep canyons where there shouldn't be.
        Also, I'm running w/ no clouds or sky effects and everything looks pretty shadowy.

    If I look at the files using FGSD I can see bad discontinuities along square grids.  
        Also, if I load the whole 10 deg directory (w180s10) it looks like some of the
        files are blank.   See the web page for images...
    http://members.interfold.com/pcazzola/mars/
      Click on thumbnails for higher resolution images.


    My questions:

    Any idea which part of the process is introducing these problems?
    I believe I ran TerraFit w/ the default error (40m?).  Is this too large?
    What are those error messages above trying to tell me?


    Thanks,
    Phil Cazzola



----------------------------------------------------------------------------


    _______________________________________________
    Terragear-devel mailing list
    [email protected]
    http://mail.flightgear.org/mailman/listinfo/terragear-devel
    2f585eeea02e2c79d7b1d8c4963bae2d


------------------------------------------------------------------------------


  _______________________________________________
  Terragear-devel mailing list
  [email protected]
  http://mail.flightgear.org/mailman/listinfo/terragear-devel
  2f585eeea02e2c79d7b1d8c4963bae2d

_______________________________________________
Terragear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/terragear-devel
2f585eeea02e2c79d7b1d8c4963bae2d