Hello,
I'm using your script to get the elevation from the horizon but I have some issue... the points are much more over the map and the horizon, them fly in the sky.
I use this function to get XZ position, and next Y position from an array of longLat:
private Vector3[] GetWorldPositionsFromHorizon(Vector2[] _coords)
{
Vector3[] positions = new Vector3[_coords.Length];
for (int ii = 0; ii < _coords.Length; ii++)
{
///Get X-Z position
Vector3 flatPosition = OnlineMapsTileSetControl.instance.GetWorldPosition
(_coords[ii]);
///Get Y position (elevation)
float elevation = GetElevationFromHorizon.instance.GetElevation(_coords[ii]);
positions[ii] = new Vector3(flatPosition.x, elevation, flatPosition.z);
}
return positions;
}
And your script just a little modified because I already have the longitude latitude of my point:
public float GetElevation(Vector2 longLat)
{
double lng = longLat.x;
double lat = longLat.y;
float elevation = 0;
if (GetElevationFromTile(lng, lat, ref elevation)) return elevation;
if (Horizon2_BingMaps.overviewElevation == null) return 0;
double mx = lng, my = lat;
OnlineMapsUtils.LatLongToMercat(ref mx, ref my);
elevation = Horizon2_BingMaps.overviewElevation.GetElevation(mx, my);
return elevation;
}
As you can see in the attached picture in top view (orthographic) the shape created with my points is ok, so X and Z are right.
The elevation (Y) is wrong
Post's attachments ISSUE.jpg 53.66 kb, 102 downloads since 2019-07-30