So I'm writing a game (or toy, rather), which involves manipulating a 3d object with the mouse. I'm trying to get the most intuitive control that I can.
I've implemented the "Arc Ball" mouse control. I'm happy with how it "feels", except for when I drag the mouse outside the range of the virtual ball.
Currently when the ray from camera to mouse-pointer in world-space does not intersect the virtual sphere, I simply find the closest point to it.
This results in something that acts like this example (not my code, just an example I found with the same implementation as me).
Notice the behaviour change when you click and drag away from the cube.
I'm not sure if it makes sense, but I am hoping for some way of allowing the cube to continue to rotate no matter how far away the mouse pointer gets, while still maintaining the useful property of standard Arc Ball that returning the pointer to the starting point will undo all rotation.
Any suggestions?
