I used to set the deprecated property “linePrecision” so that the intersectObjects(scene.children, true ) easily returns some line objects even if the mouse didn’t hit them exactly.
Now, I have some long thin CylinderBufferGeometry objects merged into a single geometry, then create a mesh on it. It looks like many lines.
When the mouse hits one of those “lines” exactly, the intersectObjects() does return a non-empty list. But, when the mouse slightly misses the target, the returned list will have 0 object in it.
I thought the Raycaster.params.Mesh.threshold would help, but whatever value I set didn’t make any difference.
Please advise me of how to lower the intersecting precision, in other words, how to get some intersected objects even if the mouse clicking position is far away from them.
That sounds like a clever trick, but I still expect the correct way to achieve that.
My app is a design tool. A lot of objects are added, deleted, and moved all the time. The length of the cylinders changes. Using your technique, I would have to adjust the size of your geometry all the time or set its size to infinity. Either way, that doesn’t sound elegant.
it is most definitely YOUR geometry, not mine. Get this right.
Great, then you have all the code already in place to create a shadow clones of these objects Now you think it is not elegant, but consider this: you dont have to have as much triangles on your cylinders if they arent visible. Hell, they could be 12-face boxes, lightning-fast both to create and to raycast against. Besides, this is what big boys do e g in Unity, look up their colliders.
You could also just override the raycast method of your mesh, copying the function of Mesh.js but expanding the triangle vertices of the test triangle along their normals before it is tested for ray intersection.
Other than that the suggestion of @munrocket would work too and be independend from the tessellation.