So yeah, this one is a seriously weird one. I’ve laid it all out in a Sandbox here and I’d love to get some input on what could be happening here.
TL:DR;
I wrote a tutorial back in October, the part that others are failing on now is that Raycasting will no longer find an object as long as it has Bones and/or a SkinnedMesh object. I thought this would be an easy debug can I don’t know where in the pipeline it’s breaking down. Whether it’s Blenders GLB export, or Three, however different versions of Three don’t appear to make a difference as far as I can tell.
In the Sandbox there are 3 GLB files. There’s a low poly character that has bones and one that doesn’t You will see in the console when you click on the character that the one with the bones doesn’t respond to the raycasting.
However, the third file is a GLB that I output in October, which correctly responds to the raycasting.
What confuses me is that putting the two Scenes objects side by side, the makeup seems identical:
Notice that raycasting with SkinnedMesh is still problematic since the engine is still unable to compute a proper AABB enclosing the maximum extend of the animated geometry. That means raycasting might still fail unless you manually define the AABB large enough.
To clarify: Before the above PR was merged, raycasting with SkinnedMesh was in fact not supported.
I’m using r159 and from what I can tell raycasting still doesn’t work with a skinned mesh. I’m loading in this test model glTF-Sample-Models/2.0/SimpleSkin/glTF-Embedded/SimpleSkin.gltf at d7a3cc8e51d7c573771ae77a57f16b0662a905c6 · KhronosGroup/glTF-Sample-Models · GitHub and it can only hit the mesh when I raycast toward points inside the yellow box (which is static and doesn’t cover the whole mesh). In r129 the same problem exists but the area where raycasting works at least covers the mesh on the initial frame of the animation instead of half in r159. Is this an issue with gltfs specifically?
Hi, I’m encountering the same problem as @viperphase1.
I have tested a veriety of models and wasn’t able to raycast to any skinned mesh.
I’m currently using r162, but I have also tried r153.
I’m no expert regarding anything 3d computer graphics related, so I can’t rule out that I missed something really basic.