Closed mrspeaker closed 8 years ago
Unfortunately, no. While the geometry is a set of points in the right position, the triangles have no area because they're expanded on the vertex shader. Three.js raycaster tests with geometries before they're processed by the GPU.
There's a solution for picking meshes that are processed in vertex shaders (skinned meshes, animated geometries, mesh lines, etc.) and is using a color buffer to check the object ID. Check this example out: http://threejs.org/examples/#webgl_interactive_cubes_gpu, I hope it helps.
Ok great! I guess this is really "by design" then - I'll close this issue off.
Ok, but you are not entirely honest here. Normal 3js lines do not have triangles too, yet you can raycast them.
@makc "not entirely honest"? wow, thanks! I might be wrong, or technically not correct, but definitely not dishonest.
Three.js lines do the intersection test by creating segments that can be tested by the raycaster (https://github.com/mrdoob/three.js/blob/317d6f66542ab63323c5dab6c7a4e9d08c07ca05/src/objects/Line.js#L26).
Something like that could be done for THREE.MeshLine, if someone had the inclination and time to do so.
I've opened issue https://github.com/spite/THREE.MeshLine/issues/8, for the adventurous that are not afraid of challenges.
which ever term you prefer, man, no hard feelings, please
I like constructive terms, with proactive solutions, if possible
Is it possible to get intersection information from MeshLines? It's possible I have something setup incorrectly, but it seems like I don't get results from intersectObjects on MeshLines, (I do with other meshes).