rhumbaflappy
January 8th, 2009, 05:37
In truth, there is no worldwide free mesh of good quality available for CFS2. FSX already has a good base mesh... but for the other Microsoft sims, a process to make decent mesh up to LOD9 levels can seem a mystery.
;----------------------------------------------------------------------------------
Tools needed:
TMFViewer ( FSX' version is the best ):
From the FSX SDK...sorry no free download available.
LWMViewer ( use if no FSX TMFViewer ):
http://www.jimkeir.co.uk/FlightSim/LWMViewer.html
LEC:
http://webpages.charter.net/ludowr/LEC.zip
FS2000 resample, mfcompress, and tmf2bgl:
http://files.fsnordic.net/?download=390
or
included with the above LEC download.
;----------------------------------------------------------------------------------
Mesh starts with the DEM data. DEM = Digital Elevational Model.
For worldwide mesh development, there is one adequate source. This is the CGIAR SRTM-based v4 DEMs. http://srtm.csi.cgiar.org/index.asp
The download area is here: http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
The data covers from N60* to S60*, and is hole-filled and noise reduced. There may be better regional mesh available for free, but for the worlwide SRTM set, this is it.
The data at CGIAR may be identified by inputting coordinates. What will be returned is a group of files to download. What is the size to input? What size do you wish to make?
I use LEC.exe to calculate my extents. LOD2-size corresponds to the cfs2 "CST" file size, and can work for LOD 5-->7 mesh resolution... LOD5-size works best for LOD 8-->9 mesh resolution. Above LOD 9 resolution, you need a better regional DEM dataset.
Start small. LOD5 sized is the default of FS9 and FSX folders. You can later develop LWM and VTP vectors for land/water masks and streams. Concentrate on areas you wish to fly or fight. Use common FS9 names, or CFS2 Regional names. Using LEC, you can find the DEM bounds. I use these bounds for the DEM search... but I'll add a degree to pad the data! You ALWAYS need source data larger than output data.
An LOD 5-sized mesh could use N44,W89 as a reference point in LEC. Generating the bounds with exact extents yields:
North 45.0
West -90.0
South 42.1875
East -86.25
I change this to the following for my search:
North 46.0 Latitude MAX
West -91.0 Longitude MIN
South 41.1875 Latitude MIN
East -85.25 Longitude MAX
;----------------------------------------------------------------------------------
...and this is what you need to input into
http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
as decimal degrees input. Make sure to select GeoTiff as the type of data, and input coordinates.
For this example I get 4 sourcefiles as selections. I don't trust any of the mirrror sites, so write down the needed zip names, and go to:
ftp://srtm.csi.cgiar.org/SRTM_v41/SRTM_Data_GeoTIFF/
and download the needed files from there. They will be the latest ( v41 )
Download all to a desktop folder named "MyMesh". Into "MyMesh" place resample, tmfcompress and tmf2bgl. UnZip the files: srtm_18_04.zip, srtm_19_04.zip, srtm_18_03.zip, srtm_19_03.zip
We're done with CGIAR.
;----------------------------------------------------------------------------------
Using MicroDem File/Open/OpenDEM, open each tif file in turn.
srtm_19_03 has missing data in lake Superior... 3Dem shows this as an odd square of data as missing instead of 179 meters... We need to fill this as 179 meters before saving as BIL: Edit/FlattenLake... select the color ( probably black ). LakeLevel 179. Some DEMs may have ocean as missing data... Edit/DEMHoles/MissingDataToSeaLevel.
Then, File/SaveDEM/BIL. Make sure you cahnge the save directory each time to your MyMesh folder.
;----------------------------------------------------------------------------------
We now have 4 BIL files. We also have 4 BLW and HDR files.. The BLW and HDR files are text files, and we may need their data for making our INF file for resample.
Now, create a new text file and save it as the FS9 name from LEC: 924160m.INF ( the m will stand for mesh ), and save it to the MyMesh folder:
;----------------------------------------------------------------------------------
[Destination]
; the lod could be 5, 6, 7, 8, or 9
LOD = 9
DestDir = "."
DestBaseFileName = "924160m"
UseSourceDimensions = 0
; exact extents from LEC
NorthLat = 45
SouthLat = 42.1875
WestLong = -90
EastLong = -86.25
; 4 16 bit binary files from microdem
[Source]
Type = MultiSource
NumberOfSources = 4
[Source1]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_18_03.BIL"
Lat = 50.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source2]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_18_04.BIL"
Lat = 45.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source3]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_19_03.BIL"
Lat = 50.00000000000000
Lon = -90.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source4]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_19_04.BIL"
Lat = 45.00000000000000
Lon = -90.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
;----------------------------------------------------------------------------------
With the INF file saved, you can now make a batch file to make the mesh:
resample 924160m.inf
tmfcompress 924160m.tmf 924160mComp.tmf
tmf2bgl 924160mComp.tmf 924160m.bgl
del *.tmf
Save this as 924160m.bat... then double-click on this BAT icon, and your mesh should start processing. An LOD5 mesh will process quickly.
;----------------------------------------------------------------------------------
Check the mesh with FSX' TMFViewer or LWMViewer ( by Jim Keir ). Zoom in and look at the corners! Does the mesh extend beyond the LOD5 bounds by a pixel? It should, and that indicates the area was covered fully. The dotted line shows the boundry, and your mesh should extend a 1/2 a pixel beyond this dotted line.
This shows there will be no gaps between adjacent mesh bgls. The mesh can go into a scenery folder. Remember to delete the 'file.dat' file in the scenery folder before testing in CFS2, or your mesh may not show. CFS2 will rebuild this file on loading the scenery.
;----------------------------------------------------------------------------------
;----------------------------------------------------------------------------------
LOD5-sized mesh at LOD 9 is good for relatively small areas, but for a world backdrop, CFS2 should have LOD2-sized mesh at LOD 7. These would be CST sized mesh files.
The exact same principles apply, with the same tools. Find the LOD2-sized bounds, expand them a degree each way, download the TIFs, process into BILs, make the INF and BAT files, naming the files as the CST4 regions ( as per LEC )... conventional for CFS2.
;----------------------------------------------------------------------------------
;----------------------------------------------------------------------------------
DEM data from N60 northwards and S60 southwards is missing from SRTM datasets.
You can use the older GTOPO30 data:
http://eros.usgs.gov/products/elevation/gtopo30/gtopo30.html
You need only download the northernmost and southernmost files. This data may not be better than the default CFS2 data, but it may be needed for padding to complete the sources for making mesh, as we ALWAYS need data sources larger than the area we wish to have as mesh. You'll need to convert these to BIL as well. This dataset can be loaded into Microdem by selecting the hdr file.
Let's say you want to make a huge CST file of the NW corner of the globe. In LEC, enter latitude of 89 and longitude of -179, LOD2 bounds, Generate:
North = 90
West = -180
South = 67.5
East = -150
Each northern gtopo file = 30* x 30* North to south we only need 1 DEM, as we can't get larger than 90* north, and 67.5 is well within the 608 southern bounds of the DEMs. But east to west, we need 2 tiles... -180 is as far as we can go, but moving east, we should add a DEM to avoid gaps in the final mesh.
We need W180N90.HDR, and W140N90.HDR. Each of these can be loaded into microdem, and converted to BIL, as above. If you've downloaded all the northern and southern sets of GTOPO30, you might as well convert all to BIL ( perhaps into a new folder for future use ). Try using Edit/DEM Holes/Missing data to sea level, before saving as BIL.
cst4000.inf:
;----------------------------------------------------------------------------------
[Destination]
; the lod could be 5, 6, 7, 8, or 9
LOD = 7 ;-------- don't go higher than lod7 for a CST file or your framerates will suffer.
DestDir = "."
DestBaseFileName = "cst4000m"
UseSourceDimensions = 0
; exact extents from LEC
NorthLat = 90
SouthLat = 67.5
WestLong = -180
EastLong = -150
; 2 16 bit binary files from microdem
[Source]
Type = MultiSource
NumberOfSources = 2
[Source1]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "W180N90.BIL"
Lat = 89.99583594062193
Lon = -179.99583333333334 ; --------------from the BLW file
NumOfLines = 6000 ; --------------from the HDR file
NumOfCellsPerLine = 4800 ; --------------from the HDR file
CellXdimensionDeg = 0.00833333376795 ; --------------from the BLW file
CellYdimensionDeg = 0.00833333376795 ; --------------from the BLW file
ScaleinMeters = 1.0
[Source2]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "W140N90.BIL"
Lat = 45.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 4800
CellXdimensionDeg = 00.00833333376795
CellYdimensionDeg = 0.00833333376795
ScaleinMeters = 1.0
;----------------------------------------------------------------------------------------------
cst4000.bat:
resample cst4000m.inf
tmfcompress cst4000m.tmf cst4000mComp.tmf
tmf2bgl cst4000mComp.tmf cst4000m.bgl
del *.tmf
Double-click the BAT file, check in TMFViewer or LWMViewer. Install to the sim. Done.
;----------------------------------------------------------------------------------------------
One last scenario involves using a combination of coarser GTOPO30 and more refined SRTM DEM data sources. This would be needed, for example, an LOD2-sized LOD 7 mesh covering 67.5*N to 45*N, as ther is no SRTM data north of 60*N.
You can use overlapping data of different cell dimensions in a multisource INF, and resample will sort it all out for you. In this way you can use the best available data, and still get full coverage for your BGL.
There are 96 CST regions ( LOD2-sized ). LOD7 mesh for these should take up about 500 Mb total storage. This is a good base mesh for CFS2. Areas of interest could have LOD5-sized mesh, along with LWM and VTP files to define land/water, beaches, roads... and would take up about 30 Mb per area ( 6144 LOD5-sized areas for the world... 184.320 Gb of file space ).
Covering the world with very flyable LOD2-sized mesh at LOD 7 is possible if we find online storage to handle 500 Mb. I can have the files ready in a couple of weeks.
Dick
;----------------------------------------------------------------------------------
Tools needed:
TMFViewer ( FSX' version is the best ):
From the FSX SDK...sorry no free download available.
LWMViewer ( use if no FSX TMFViewer ):
http://www.jimkeir.co.uk/FlightSim/LWMViewer.html
LEC:
http://webpages.charter.net/ludowr/LEC.zip
FS2000 resample, mfcompress, and tmf2bgl:
http://files.fsnordic.net/?download=390
or
included with the above LEC download.
;----------------------------------------------------------------------------------
Mesh starts with the DEM data. DEM = Digital Elevational Model.
For worldwide mesh development, there is one adequate source. This is the CGIAR SRTM-based v4 DEMs. http://srtm.csi.cgiar.org/index.asp
The download area is here: http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
The data covers from N60* to S60*, and is hole-filled and noise reduced. There may be better regional mesh available for free, but for the worlwide SRTM set, this is it.
The data at CGIAR may be identified by inputting coordinates. What will be returned is a group of files to download. What is the size to input? What size do you wish to make?
I use LEC.exe to calculate my extents. LOD2-size corresponds to the cfs2 "CST" file size, and can work for LOD 5-->7 mesh resolution... LOD5-size works best for LOD 8-->9 mesh resolution. Above LOD 9 resolution, you need a better regional DEM dataset.
Start small. LOD5 sized is the default of FS9 and FSX folders. You can later develop LWM and VTP vectors for land/water masks and streams. Concentrate on areas you wish to fly or fight. Use common FS9 names, or CFS2 Regional names. Using LEC, you can find the DEM bounds. I use these bounds for the DEM search... but I'll add a degree to pad the data! You ALWAYS need source data larger than output data.
An LOD 5-sized mesh could use N44,W89 as a reference point in LEC. Generating the bounds with exact extents yields:
North 45.0
West -90.0
South 42.1875
East -86.25
I change this to the following for my search:
North 46.0 Latitude MAX
West -91.0 Longitude MIN
South 41.1875 Latitude MIN
East -85.25 Longitude MAX
;----------------------------------------------------------------------------------
...and this is what you need to input into
http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
as decimal degrees input. Make sure to select GeoTiff as the type of data, and input coordinates.
For this example I get 4 sourcefiles as selections. I don't trust any of the mirrror sites, so write down the needed zip names, and go to:
ftp://srtm.csi.cgiar.org/SRTM_v41/SRTM_Data_GeoTIFF/
and download the needed files from there. They will be the latest ( v41 )
Download all to a desktop folder named "MyMesh". Into "MyMesh" place resample, tmfcompress and tmf2bgl. UnZip the files: srtm_18_04.zip, srtm_19_04.zip, srtm_18_03.zip, srtm_19_03.zip
We're done with CGIAR.
;----------------------------------------------------------------------------------
Using MicroDem File/Open/OpenDEM, open each tif file in turn.
srtm_19_03 has missing data in lake Superior... 3Dem shows this as an odd square of data as missing instead of 179 meters... We need to fill this as 179 meters before saving as BIL: Edit/FlattenLake... select the color ( probably black ). LakeLevel 179. Some DEMs may have ocean as missing data... Edit/DEMHoles/MissingDataToSeaLevel.
Then, File/SaveDEM/BIL. Make sure you cahnge the save directory each time to your MyMesh folder.
;----------------------------------------------------------------------------------
We now have 4 BIL files. We also have 4 BLW and HDR files.. The BLW and HDR files are text files, and we may need their data for making our INF file for resample.
Now, create a new text file and save it as the FS9 name from LEC: 924160m.INF ( the m will stand for mesh ), and save it to the MyMesh folder:
;----------------------------------------------------------------------------------
[Destination]
; the lod could be 5, 6, 7, 8, or 9
LOD = 9
DestDir = "."
DestBaseFileName = "924160m"
UseSourceDimensions = 0
; exact extents from LEC
NorthLat = 45
SouthLat = 42.1875
WestLong = -90
EastLong = -86.25
; 4 16 bit binary files from microdem
[Source]
Type = MultiSource
NumberOfSources = 4
[Source1]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_18_03.BIL"
Lat = 50.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source2]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_18_04.BIL"
Lat = 45.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source3]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_19_03.BIL"
Lat = 50.00000000000000
Lon = -90.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
[Source4]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "SRTM_19_04.BIL"
Lat = 45.00000000000000
Lon = -90.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 6000
CellXdimensionDeg = 0.00083333335351
CellYdimensionDeg = 0.00083333335351
ScaleinMeters = 1.0
;----------------------------------------------------------------------------------
With the INF file saved, you can now make a batch file to make the mesh:
resample 924160m.inf
tmfcompress 924160m.tmf 924160mComp.tmf
tmf2bgl 924160mComp.tmf 924160m.bgl
del *.tmf
Save this as 924160m.bat... then double-click on this BAT icon, and your mesh should start processing. An LOD5 mesh will process quickly.
;----------------------------------------------------------------------------------
Check the mesh with FSX' TMFViewer or LWMViewer ( by Jim Keir ). Zoom in and look at the corners! Does the mesh extend beyond the LOD5 bounds by a pixel? It should, and that indicates the area was covered fully. The dotted line shows the boundry, and your mesh should extend a 1/2 a pixel beyond this dotted line.
This shows there will be no gaps between adjacent mesh bgls. The mesh can go into a scenery folder. Remember to delete the 'file.dat' file in the scenery folder before testing in CFS2, or your mesh may not show. CFS2 will rebuild this file on loading the scenery.
;----------------------------------------------------------------------------------
;----------------------------------------------------------------------------------
LOD5-sized mesh at LOD 9 is good for relatively small areas, but for a world backdrop, CFS2 should have LOD2-sized mesh at LOD 7. These would be CST sized mesh files.
The exact same principles apply, with the same tools. Find the LOD2-sized bounds, expand them a degree each way, download the TIFs, process into BILs, make the INF and BAT files, naming the files as the CST4 regions ( as per LEC )... conventional for CFS2.
;----------------------------------------------------------------------------------
;----------------------------------------------------------------------------------
DEM data from N60 northwards and S60 southwards is missing from SRTM datasets.
You can use the older GTOPO30 data:
http://eros.usgs.gov/products/elevation/gtopo30/gtopo30.html
You need only download the northernmost and southernmost files. This data may not be better than the default CFS2 data, but it may be needed for padding to complete the sources for making mesh, as we ALWAYS need data sources larger than the area we wish to have as mesh. You'll need to convert these to BIL as well. This dataset can be loaded into Microdem by selecting the hdr file.
Let's say you want to make a huge CST file of the NW corner of the globe. In LEC, enter latitude of 89 and longitude of -179, LOD2 bounds, Generate:
North = 90
West = -180
South = 67.5
East = -150
Each northern gtopo file = 30* x 30* North to south we only need 1 DEM, as we can't get larger than 90* north, and 67.5 is well within the 608 southern bounds of the DEMs. But east to west, we need 2 tiles... -180 is as far as we can go, but moving east, we should add a DEM to avoid gaps in the final mesh.
We need W180N90.HDR, and W140N90.HDR. Each of these can be loaded into microdem, and converted to BIL, as above. If you've downloaded all the northern and southern sets of GTOPO30, you might as well convert all to BIL ( perhaps into a new folder for future use ). Try using Edit/DEM Holes/Missing data to sea level, before saving as BIL.
cst4000.inf:
;----------------------------------------------------------------------------------
[Destination]
; the lod could be 5, 6, 7, 8, or 9
LOD = 7 ;-------- don't go higher than lod7 for a CST file or your framerates will suffer.
DestDir = "."
DestBaseFileName = "cst4000m"
UseSourceDimensions = 0
; exact extents from LEC
NorthLat = 90
SouthLat = 67.5
WestLong = -180
EastLong = -150
; 2 16 bit binary files from microdem
[Source]
Type = MultiSource
NumberOfSources = 2
[Source1]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "W180N90.BIL"
Lat = 89.99583594062193
Lon = -179.99583333333334 ; --------------from the BLW file
NumOfLines = 6000 ; --------------from the HDR file
NumOfCellsPerLine = 4800 ; --------------from the HDR file
CellXdimensionDeg = 0.00833333376795 ; --------------from the BLW file
CellYdimensionDeg = 0.00833333376795 ; --------------from the BLW file
ScaleinMeters = 1.0
[Source2]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "W140N90.BIL"
Lat = 45.00000000000000
Lon = -95.00000000000000
NumOfLines = 6000
NumOfCellsPerLine = 4800
CellXdimensionDeg = 00.00833333376795
CellYdimensionDeg = 0.00833333376795
ScaleinMeters = 1.0
;----------------------------------------------------------------------------------------------
cst4000.bat:
resample cst4000m.inf
tmfcompress cst4000m.tmf cst4000mComp.tmf
tmf2bgl cst4000mComp.tmf cst4000m.bgl
del *.tmf
Double-click the BAT file, check in TMFViewer or LWMViewer. Install to the sim. Done.
;----------------------------------------------------------------------------------------------
One last scenario involves using a combination of coarser GTOPO30 and more refined SRTM DEM data sources. This would be needed, for example, an LOD2-sized LOD 7 mesh covering 67.5*N to 45*N, as ther is no SRTM data north of 60*N.
You can use overlapping data of different cell dimensions in a multisource INF, and resample will sort it all out for you. In this way you can use the best available data, and still get full coverage for your BGL.
There are 96 CST regions ( LOD2-sized ). LOD7 mesh for these should take up about 500 Mb total storage. This is a good base mesh for CFS2. Areas of interest could have LOD5-sized mesh, along with LWM and VTP files to define land/water, beaches, roads... and would take up about 30 Mb per area ( 6144 LOD5-sized areas for the world... 184.320 Gb of file space ).
Covering the world with very flyable LOD2-sized mesh at LOD 7 is possible if we find online storage to handle 500 Mb. I can have the files ready in a couple of weeks.
Dick