Normalize and smooth mouse movements?

Is there a way to smooth mouse movements? I want to remove all the little jitter in a regular mouse by moving my hand, since you can never draw a clean line in the paint because you are making small jittery movements.

It may be hard to understand what I mean, but if you know zbrush, they have a function called lazy mouse http://www.pixologic.com/docs/index.php/Lazy_Mouse im looking for a way to recreate this inside my application. I can read the mouse position using Cursor.Position , but I did not find a way to average these numbers before they are sent to the pointer on the screen.

+7
source share
1 answer

This is only possible if you can slow down the mouse movement a little. You record mouse movement points at a specific frequency, and then line them up. Then use this line to draw everything you need. You cannot directly position the mouse cursor in the average position, as this will lead to feedback in your program as a new mouse movement.

Make sure that you create it so that you can set the time for delaying the movement of the mouse and how aggressive the averaging is (for example, by limiting the number of points included in it) and the frequency with which you record the movements of the mouse (this can affect the use of the processor if it is too often).

Of course, you have to create some kind of mouse abstraction in your application and create a way so that the application can hold it. (I would try to make it as similar as possible to regular winforms / wpf, so that I can undo the change and just use the mouse movement directly if necessary).

+2
source

All Articles