Re: Some problem extending the horizon
Hello, I'm using your 1st tip (calculate the offset for the first point, and apply this offset for the remaining points) when the map is moved, but I have a problem: on top view it seem ok, but tilting the map it's evident that the elevation of the points is not correctly calculated.
This is a video to show you what I mean (from second 10)
https://vr.alicefit.com/ice_video_20190808-192152.webm
I've seen that also just panning the map I get "OnElevationUpdated" at the end of the movement (that's why when I release the mouse the track get correctly calculated).
So I have idea that this 1st tip cannot be used... I'm doing it wrong?
This is my code (p.s. I'm still using Vectrosity but this is not the issue, because if moving the map I call "UpdateLine", just like with "OnChangeZoom" and with "OnElevationUpdated", it work.
private void Start()
{
OnlineMaps.instance.OnChangeZoom += UpdateLine;
OnlineMaps.instance.OnChangePosition += OnMapPan;
OnlineMapsElevationManagerBase.instance.OnElevationUpdated += UpdateLine;
}
....
void OnMapPan()
{
///Get the distance difference only for the 1st point
Vector3 oldPos = _convertedWordlPositionsToList[0];
Vector2 firstCoord = _coords[0];
Vector3 newPos = GetWorldPositionFromCoordinates(firstCoord);
Vector3 difference = newPos - oldPos;
///Apply the difference to all points
for (int ii = 0; ii < _convertedWordlPositionsToList.Count; ii++)
{
_convertedWordlPositionsToList[ii] += difference;
}
///Update line
myLine.points3 = _convertedWordlPositionsToList;
myLine.Draw3D();
}
}
void UpdateLine()
{
_convertedWordlPositionsToList = GetWorldPositionsFromCoordinates(_coords);
myLine.points3 = _convertedWordlPositionsToList;
myLine.Draw3D();
}