3 ms·
Judging from the demos, it feels like this code is treating each point with an equal weight, regardless of velocity. My mouse is configured to send 500 events
by nitrogen 14y ago
Judging from the demos, it feels like this code is treating each point with an equal weight, regardless of velocity. My mouse is configured to send 500 events per second, so the smoothing doesn't smooth all that much.
Depending on the latency limitations of the application in question, it seems like it would be better to use a curve simplifying algorithm similar to the one used by Inkscape, or maybe just dividing the curve into equally spaced points on the plane (instead of equally spaced points in time), taking care to preserve obvious changes in direction (perhaps by adding a point anywhere the locally smoothed first or second derivative crosses zero).