See following fiddle:
https://jsfiddle.net/1jmws2bp/
If you move the mouse over the line or the circle, it should change color to white (works for me, locally, in jsfiddle sometimes there is a bit of an offset, not entirely sure why).
Problem is, that if you change Line 22: to var circle = new THREE.Mesh(geometry, material)
the circle is filled out (as intended), but if you now hover it now, it won't update color.
Why is that? If I manually add this:
scene.children[0].material.color.setHex(0xff0000);
it does work. So somehow it looks to me that with a Mesh the RayCaster does not see the intersection. (Verified by adding this line
alert("intersection");
after if (intersects.length > 0)
no alert if I use Mesh
instead of Line
)