Jump to content
Sign in to follow this  
Guest kaltduscher

custom terrain textures and x/y ratio

Recommended Posts

Guest kaltduscher

hi,I am bit confused about the distortion of bitmaps when creating custom terrain textures from bitmap files. I understand that resample.exe distorts the source bitmap depending on the latidude of the target tile. and that lon and lat have to have certain values only to avoid black borders (match th FS grid).But what I would like to understand is: how is this calculation performed? Given a target position of x deg lat and y deg lon. What width and height has my source bitmap to have to produce exactly one target 256x256 tile so that both bitmaps have identical contents (nothing lost, nothing added)? Has somebody found out what algorithm is behind there? Any help would be appreciated. I looked around and found a lot of tutorials but could nowhere find a detailed description about the projection mechanism.Jens

Share this post


Link to post
Share on other sites

Hi Jens.resample doesn't necessarily distort anything. If your source is lat/long and equiangular, there will be no distortion by resample.Distortion is caused by the sim's runtime interpretation of the texture based on the latitude of the LOD13 tile.All ground tiles, as well as VTP and LWM polys and lines, are expressed as degrees, not meters.The world can be seen a being bands of LOD13 ground tiles that encircle the earth. There are ( I think ) 16,384 bands from pole to pole. The bands would always be of equal height. Each band would have ( I think ) 24576 tiles. The same number if they are near the poles or if they are near the equator. So they must stretch their widths near the equator to cover the band, and shrink their widths to not overlap near the poles.Dick

Share this post


Link to post
Share on other sites

To add to Dick's message, you may be confusing image quality degradation with distortion.Resample does degrade the quality of the image when it does a resampling, other programs do a better job, but if you present an image scaled to 4.8 m/pixel at the equator, then you minimize quality loss.A thread exists on this forum discussing a freeware method of reprojecting images, read that one...perhaps that will help. I find I still tweak the celldimx and celldimy values to have the image match the mesh.Bob B

Share this post


Link to post
Share on other sites
Guest kaltduscher

Hi Bob and dick,thanks for your additional information. I was confused by a tutorial that I read which did not distinguish between design time and run time.I found out that the reason for my distortion was simply becauce I exchanged the CellXYdimensiondeg values in the .inf file ;CellXdimensionDeg = 0.00004291534423828125;CellYdimensionDeg = 0.000057220458984375CellXdimensionDeg = 0.000057220458984375CellYdimensionDeg = 0.00004291534423828125So now this is much clearer for me and I was able to generate an undistorted bitmap (Anyway I wonder how resamples manages it to produce such a bad quality even if it must not resample at all ;-)Is there some reason why MS chooses differen resolutions for latitude and longitude in their tile raster (the earth is almost a ball...)? "Each terrain cell falls on multiple of 360/32768 degrees latitude, which is 0.010986328125 decimal degrees and 480/32768 degrees longitude"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...