Re: [Algorithms] mouse smoothing
Brought to you by:
vexxed72
|
From: Fabian G. <f.g...@49...> - 2009-09-13 05:49:00
|
Tom Plunket wrote: >>> Yeah, there is some non-trivial approach to doing this, and it's done by >>> the OS. :-) >>> >>> In Windows, you can adjust parameters related to this. The most notable >>> (in my opinion) is the acceleration slider which is a power function on >>> the velocity. >> That's not doing any smoothing either, though; quite the opposite, it >> further exaggerates the input mouse motions. > > I had guessed that it downward expanded slow movement, too, but I never > really dug into it to see for sure. There is the mouse speed slider, too, > though, which scales the velocity linearly, which could "damp" the motion > in a different way. There's a small article explaining the mouse acceleration algorithm used in Windows XP: http://www.microsoft.com/whdc/archive/pointer-bal.mspx It's hard to say for sure whether it's slowing down small motions since there's no "1:1 translation" reference curve in the graphs. However, the curves are piecewise linear with no huge slope differences; if there's any downward scaling done at some point, its effect would be quite mild. > I wonder, though, if the input is noisy but is sufficiently filtered by > the software path. I mean some of these mice claim 1000dpi, I can't > imagine they're not going to have some jitter at the hardware sampling > level. Not sure what happens at the mouse firmware level to get data this sparkly clean (well, unless you're on a surface it can't track properly on...) :). But you can get the raw delta mickeys from the raw input API on Windows (or DirectInput too for that matter) and just by directly opening the USB device on Linux. Aside from the obvious lack of mouse acceleration (which may be what you want in your game!), the values are just as noiseless as the mouse pointer coordinates. -Fabian |