Hi,
One easy way would be to measure the number of pixels the mouse had moved since the previous frame.
I attached an example that spits out 20 values per second, each number is the number of pixels the cursor has travelled since the previous frame.
This patch only measures in the horizontal direction for simplicity. To also put the vertical axis in consideration, you will have to get the square root of (X^2 + Y^2)
Also if the numbers change too rapidly for your needs, you will have to add some function to smooth the value changes.
I hope this is of some help.
-- David Shimamoto
Hi,
I have a really simple question: Does anyone know how to make a patch that will give me the speed the mouse is moving? I'm on windows and am using gemmouse to get the position.
Thanks in advance! Rebecca.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list