I am developing an application that involves plotting paths. The mouse is used to select a start and end point on the surface of the globe, and a path is drawn between them. When I am picking on the WGS84 ellipsoid things seem to be ok and the line is drawn between the two points I would expect. When I add a terrain provider things start to get very unpredictable (just as an aside, the terrain support is amazing btw! love it). The picked points are often floating in the air, and almost never where I would expect them to be. I am aware of the sampleTerrain function, and I have used it to lower the picked points to be at terrain height, but height aside, the points are in the wrong location. I am using globe.pick(). My interpretation of the API documentation is that this function should pick on the terrain and not the reference ellipsoid, is that correct? My feeling is that it might be an issue with the intersection calculation between the pick ray and the terrain.
The geographical region that I am testing in is, I believe, below the surface of the ellipsoid, so I do wonder if this might be significant?
I have created a jsfiddle to demonstrate this issue - http://jsfiddle.net/vdekdt5r/17/
To use it, you'll want to zoom in a little further, and rotate the view to an isometric one. Picking seems to work ok from the nadir view. Right click on two different points on the scene, and then rotate around again to see where the line has been drawn.
I've also got some images showing the issue. The first image shows a line created by click on two points on the terrain. The subsequent images are the same line, with the view rotated.
Thanks for any help you can give me!