Click on the screen coordinates to pan the camera controller
It can be done by raycaster to get the coordinate where your mouse has clicked, then copy the raycaster object point to the camera target, add lerp so it pans smoothly.
Screen coordinates are inherently 2D, while a controller’s target is 3D. So there are an infinite number of 3D coordinates (along a cast ray) which would yield the same screen coordinate.
While a raycaster returns the 3D coordinates of the first (closest) surface of a three,js geometry (while there is one), I expect the result of clicking an empty spot on the screen to be void / null or undefined.
2 Likes