I’ve just updated the code so it can run online, and added it to my online demos
Mouse Tracking code | try it | discussion thread
Originally written in 2017, this demo is a game where the object is to destroy targets using the mouse, where the mouse control has been rotated.
I’ve added some comments and made some components clearer.
The key is that there are two mouse locations – the real one (which is invisible) and the visible one. I therefore need objects (polygon targets) at both locations. When the participants thinks they are clicking on the visible target, in reality their invisible mouse cursor is clicking on the invisible target.