I am trying to detect clicks on my Plane mesh. I set up a raycaster using the examples as a guide.
Here is the code: http://jsfiddle.net/BAR24/o24eexo4/2/
When you click below the marker line, no click will be detected even though the click was inside the plane (marker line has no effect).
Also try resizing the screen. Then, even clicks above the marker line may not work.
Maybe this has to do with use of an orthographic camera? Or not updating some required matrix?
function onMouseDown(event) {
event.preventDefault();
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
//console.log("x: " + mouse.x + ", y: " + mouse.y);
raycaster.setFromCamera(mouse, camera)
var intersects = raycaster.intersectObjects(objects);
if (intersects.length > 0) {
console.log("touched:" + intersects[0]);
} else {
console.log("not touched");
}
}