1

Hi i am try to catch click event for text-object in three js using raycast.

  1. Event is triggering
  2. The problem is when i exactly clicking on object its not triggered.
  3. 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);
  1. Event is triggered when click the high lighted area in the below snap. (Not the expected object comes)

enter image description here

  1. But actually it needs to triggered when i click the highlighted area in image.

enter image description here

Subramani
  • 347
  • 3
  • 11

0 Answers0