This is great, nice work guys!
Some feedback on the “Ground Altitude Data” example. The method this example uses for querying terrain heights is kind of ok when you’re zoomed in, but it returns total nonsense when you’re zoomed out. To see what I mean, zoom out until the entire globe is visible and then hover the cursor in the Pacific ocean off the coast of California. Cesium reports heights like -40k kilometers.
This is because low detail triangles cut deeply through the Earth. You can improve this somewhat by interpolating heights instead of positions. Figure out what triangle you’re in, get the heights at each of the three vertices of the triangle, find your barycentric coordinates within the triangle, interpolate the height at those barycentric coordinates. This gives better results, but still not amazing.
In National Map we go a step further and report a height +/- error bounds while moving the mouse, and then do an accurate height sample when the mouse stops moving.
Code for both techniques is here if it helps:
Note that I had to add a pickTriangle method to Cesium’s Globe. pickTriangle is identical to pick except that it also returns the vertices of the triangle that the pick hit instead of just the Cartesian location. Code for that is in the “nm” Cesium branch.