jonforum Posted May 23, 2018 Share Posted May 23, 2018 Would anyone know a method or algorithm in JS to calculate and detect if a mouse is moving by a circle around a target? Example if a rotate mouse *4 time around a specific XY point, i would like to re-center my camera (in my context i need algoritme for a camera engine) I search i little bit on the web, but no found good formula to perform this. Maybe a will need a special api ? or easy trick to do this ? in context, the target position are know, i need to find a way to check if the mouse do multiple circled rotation around this target XY, in a timeLaspe (maybe 1000 or 2000 ms) thank for suggest. Quote Link to comment Share on other sites More sharing options...
BobF Posted May 23, 2018 Share Posted May 23, 2018 Perhaps think of the space around the target as a square divided into four quadrants with the target at the center? It would be relatively easy to detect when the mouse enters a particular quadrant, so if the mouse enters all four quadrants in order multiple times then it has circled the target multiple times. jonforum 1 Quote Link to comment Share on other sites More sharing options...
jonforum Posted May 24, 2018 Author Share Posted May 24, 2018 2 hours ago, BobF said: Perhaps think of the space around the target as a square divided into four quadrants with the target at the center? It would be relatively easy to detect when the mouse enters a particular quadrant, so if the mouse enters all four quadrants in order multiple times then it has circled the target multiple times. nice idea thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.