Topic: Map with elevation has hickup
Hello Alex,
when using the map with the elevation feature (I am using the Fly scene again), it works fine in principle, but from time to time (after a certain distance on the map has been moved) the map stutters. With stutter, I mean that all vertices change their position from one frame to the next and mountains look completely different than before.
How to reproduce:
Load the Fly scene, check the Use Elevation feature and enter a Bing API Key.
Latitude is set at 46.1714515686035 and Longitude is set to 8.84636116027832, but I guess this is the default in the Fly scene.
Change the Aircraft Speed to e.g. 3000, so that the problem appears more often. It will happen all 5-6 seconds then.
Look at the mountains. They will hickup all 6 seconds.
I have the impression, that always, if a new tile update is downloaded from the server, the information is suddenly applied to the mesh and therefore it looks like a stutter / hickup.
I tried to solve the problem myself, by interpolating between the mesh manipulations, but I wasn't successful.
In OnlineMapsTileSetControl in Method UpdateMapMesh() there is a line that changes the mesh:
tilesetMesh.vertices = vertices;
I commented out this line and did the following instead:
Vector3[] changedVertices = vertices;
Vector3[] meshVerticesCache = tilesetMesh.vertices;
for (int ii = 0; ii < vertices.Length; ++ii)
{
changedVertices[ii].y = Mathf.Lerp(meshVerticesCache[ii].y, vertices[ii].y, 0.1f);
}
tilesetMesh.vertices = changedVertices;
Now the changes were smoother in general, but the hickup was there anyway.
I hope you can reproduce and fix this issue.
Thank you again in advance
Clemens