Closed DoMoCo closed 1 year ago
Hello! What's your use case? Why are you using the static geometry generator if you need to identify which geometry has been intersected with?
If you really need to use the static geometry generator and still identify the intersected geometry I recommend adding a vertex attribute for each triangle with a mesh index so you can dereference to the associated geometry later.
Thank you for your attention!
My use case is: There are many planes in the scene and I want to click on a plane with the mouse. I can achieve this with the raycaster of three.js, but I want to accelerate it. Then I found three-mesh-bvh but I don't know how to use it even after many tries.
Why are you using the static geometry generator if you need to identify which geometry has been intersected with?
To answer this question that building bvh for a single plane doesn't seem to make sense.
To answer this question that building bvh for a single plane doesn't seem to make sense.
Yes you're right - in the long term this is a use case that would be served best by a scene-level or instanced mesh acceleration structure.
I think right now this is probably your best bet:
If you really need to use the static geometry generator and still identify the intersected geometry I recommend adding a vertex attribute for each triangle with a mesh index so you can dereference to the associated geometry later.
Thanks to face.materialIndex
, I found the correspondence between intersected triangle and the related plane. Feel free to close this issue now.
I have already submitted another question, looking forward to the your answer.
Thanks again.
I just want to get intersected mesh not triangle. I don't get any idea about it after reading a lot of issues.
Thanks a lot.