Closed javagl closed 6 months ago
For the specific case here, one veeeery deep root problem is what I found after adding some ridiculous debug logging of the vertex coordinates of each triangle of a unit square that was supposed to be tested for intersections:
Got (0, 0, 1) (0, 0, 1) (1, 0, 0) for 1 3 2
Wait, what? Yeah. The part at https://github.com/CesiumGS/cesium/blob/a47c95e1ad2601c329d367b0159dca00599b72d2/packages/engine/Source/Scene/Model/pickModel.js#L247 does not work for interleaved buffers.
When storing that unit square with non-interleaved buffers, it works.
I'll try to fix that, but will probably not be able to resist the urge do to a few other cleanups there as well. But I'll have to further wrap my head about some interdepdencies there - what's the role of the WebGL2 frame state and these typed arrays, or how attempting to fix the issue about interleaved buffers may be affected by the quantization. Eventually, it may include
defaultValue
getVertexPosition
...)@javagl thanks for the test cases! Here's what I get from your sphere & airplane case after #11842
(This is a spin-off from https://github.com/CesiumGS/cesium/issues/11814#issuecomment-1932619298 , where the info that is posted here has been removed)
This model is a (low-resolution) sphere that can be put into the
/Apps/SampleData/models/CesiumAir/
for the test:sphere_V60_radius_5.zip
Then one can run this sandcastle locally:
It will load both models, and check for intersections while picking. Intersections with the plane will be shown in yellow. Intersections with the sphere will be shown in red. Here's what it does:
From what I can tell, there clearly are places where it does not pick the sphere although it should. And there clearly are places where it picks the plane although it shouldn't.