I'm working on a project to develop an interactive globe where users can drag points on the surface using their mouse cursor.
Here is the code snippet I've been working on
Currently, I've managed to set up the main sphere and a smaller red sphere as an example point. However, I'm struggling with ensuring that the small point stays on the surface of the main sphere when dragged.
For context, my code consists of two spheres: the primary one and a smaller red one. I've implemented orbit controls and a Raycaster to enable dragging functionality for the smaller sphere, but I need help limiting its movement to the surface of the larger sphere.