changed TerrainLat(1) to 30 as I think I had that wrong but still same depth at the beginning.
Registration is only required if you want to post, and is not needed to read any posts. To avoid excess 'spam' accounts, all accounts where no posts have been made will be deleted after two weeks. Please register again if you wish to post.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
private const double EARTH_RADIUS = 6371000; //in meters
double dTerrainXWidth = dTerrainLongExtent * 2 * Math.PI * EARTH_RADIUS * Math.Cos(dTerrainLat + (dTerrainLatExtent / 2)) / 360;
double dTerrainZWidth = dTerrainLatExtent * 2 * Math.PI * EARTH_RADIUS / 360;
double Longitude = (dXPosition * dTerrainLongExtent / dTerrainXWidth) + dTerrainLong;
double Latitude = (dZPosition * dTerrainLatExtent / dTerrainZWidth) + dTerrainLat;