Currently, the object rotates when clicked and dragged.
I am trying to find the formulas required to achieve a realistic spinning effect once the user has "let go."
So far I've calculated the initial angular velocity of the object like so:
(rotation in degrees of final grab - rotation in degrees of initial grab) / ((timestamp of final grab - timestamp of initial grab) * 1000)
The browser's console displays the angular velocity once you've let go of your grab.
The problem is that this is not very realistic for several reasons:
- If you drag left slowly and then drag right very fast and let go, it becomes obvious that just setting the wheel to rotate according to the calculated angular velocity is not very realistic. What is the correct formula to describe the object's initial angular velocity after letting go?
- I would also like to incorporate friction so that the wheel slows down realistically. What is the correct formula to describe the object's angular velocity over time?
I really appreciate any help.