THREE.JS - How to set the length of vector based on angle between camera position and mouse cursor position?
问题 In my project, using Three.JS I have implemented the functionality where I want my camera to zoom to the cursor position. Below is the function for that. In this function, I am using a factor as static value 5. onWheelMove = (event: WheelEvent): void => { let rect: ClientRect = this.canvas.getBoundingClientRect(); var factor = 5; this.mousePos.x = (event.clientX - rect.left) / this.renderer.domElement.width * 2 - 1; this.mousePos.y = -(event.clientY - rect.top) / this.renderer.domElement