Hi, during my experiments on Cesium I came across two problems that break the project I'm attempting to port to Cesium. I need to keep a vehicle above ground while it is moving around the globe, and the Camera is following that vehicle at a certain distance. Example: http://dev.youbeq.com/Apps/Sandcastle/gallery/FollowModel.html .
While driving around I keep getting undefined values for the current Height, and terrain elevation keeps on changing usually on the base of the camera, the elevation drops or increases drastically making the vehicle jump around like crazy. Even if I wait for the terrain data to load around me when I start driving around that behaviour shows up and elevations keep on changing radically.
What can I do to improve the consistency of the heights returned for the terrain (getting undefined values breaks the realism of the movement)? And how can I prevent the terrain from losing detail around the area I'm currently at?
What I'm doing to get the height for a Latitude, Longitude is:
var position = Cesium.Cartesian3.fromDegrees(lng, lat, 0, ellipsoid, new Cesium.Cartesian3());
var altitude = scene.globe.getHeight(Cesium.Ellipsoid.WGS84.cartesianToCartographic(position));