I am attempting to replicate the functionality of drawing lines on the terrain that is found in this Sandcastle example.
However, the only time points or lines are drawn is when my cursor is over an object that has been added to the scene such as a model, label, etc. When the cursor is just over the globe the events don’t work.
I’m convinced there’s a simple reason for this, but I’m not sure what to look for. Why would these listeners only fire when the cursor is over objects in the scene and not the globe itself?
I discovered that the listeners are firing just fine. It’s actually the value being returned from viewer.scene.pickPosition that’s the issue. It’s not returning the position under the cursor unless the cursor is over an object that has been added to the scene. Instead… if the cursor is just over the globe then the position being returned is quite a distance from the cursor. Any ideas about why this is happening would be appreciated.
Is viewer.scene.pickPosition the best way to get the most accurate point on the ground?