Hi i am try to catch click event for text-object in three js using raycast.
- Event is triggering
- The problem is when i exactly clicking on object its not triggered.
- When i click little above to the object its triggered the event.
below is my snippet
// CLick event binding
var mouse = new THREE.Vector3();
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
// mouse.z = 0.5;
// mouse.normalize();
var raycaster = new THREE.Raycaster();
raycaster.setFromCamera(mouse, camera);
var intersects = raycaster.intersectObjects( sceneObjects);
- Event is triggered when click the high lighted area in the below snap. (Not the expected object comes)
- But actually it needs to triggered when i click the highlighted area in image.