I am working on a Three.js app where I need to determine the object that the perspective camera is focusing on. In order to achieve this, I consulted the raycaster documentation. Most of the resources I came across discuss using raycasting with a camera and Vector2 based on mouse coordinates. However, I do not want to rely on the 2D coordinates of the mouse for this purpose. The camera in my app can rotate due to various interactions such as clicking and dragging on the screen, touch controls, or even VR controls. What I specifically aim to do is perform a raycast from the center point of the perspective camera and highlight/select the object it is looking at.
Any advice or suggestions on how I can achieve this?