A concise explanation of the problem you’re experiencing.
Is there a way to set the sensitivity of this picker, similar to the window parameters of drillPick(), or something similar?
Context. Why do you need to do this? We might know a better way to accomplish your goal.
I’m picking points (for drawing lines, etc.) on various pointclouds, but because pointclouds are, eh, cloudy, very often the scene.pickPosition() falls through the cracks and hits the ground.
I think pickPosition already just picks only the given pixel. I think the discrepancy you’re seeing might be due to the point positions not being stored on the CPU and having to be reconstructed from the depth buffer. There’s an issue on this here: https://github.com/CesiumGS/cesium/issues/7953
With that said you could avoid these “misclicks” at least by also doing a pick at the same time to check if you hit the point cloud or not, and if you haven’t ignore that click. This was the suggested approach here: https://github.com/CesiumGS/cesium/issues/7953#issuecomment-562217824
Thanks for that. I did find some of those references helpful, at least in understanding the problem.
I think the vertex buffer hits different things from the normal [drill]pick() methods. I did write a function that did a drillPick() with a 1x1 window, and if there was a tileset in the stack (had to filter, as I’ve got other entities being dragged around as well) I did the pickPosition(). But, as the story goes, a pick() 1x1 does not hit the same as a pickPosition() [1x1]. Maybe it improves precision slightly, but the performance hit is massive (I do this on mouse move).
I also played with the sizes of points and such, but with little luck (I’m guessing the vertex picking uses the data, and not the visual representations of it). I also got a huge performance hit from doing several drillPick() w/filtering and then pickPosition() as I’m using this with mouse move (showing different cursors depending on what the user is doing). I converted all of them to use propertyCallback(), but I think drillPick() is just too heavy.
I’m now toying with a streamed buffer of pickPosition() that’s filtered for anomalies, so the average of 10 mouse points gives me the closest point, but I’m now having issues with an issue that if I pickpositions x=5,y=5, and then right after do x=6,y=6, I get the same Cartesian3 coordinates back for both, like it’s cached? It’s very odd, I’m testing to see what’s going on there.
The best solution would be if the pickPosition() could have a window option similar to pick(), as a means to define a scatter window. Any other options you can think of? Is it worth looking into the source for pickPosition()?