lag and bounce

Jul 31, 2011 at 3:22 AM

I see two issues with the code:

1. The mouse lags a half second behind the hand controlling the location.

2. When I move my hand with some speed across the screen and then stop suddenly, the mouse "bounces". It goes past the spot where my hand stopped, and then travels back to the correct location.

Does anyone have any idea why these issues might be happening, or how to fix them? I have a decent machine with a quad-core cpu. Performance especially doesn't seem to be able to explain the "bounce".


Aug 12, 2011 at 6:55 AM

Because skeletal tracking isn't exact, a smoothing algorithm is used to reduce the "jitter" associated with recognition of a specific part of the body, such as a hand.  Without smoothing, the mouse cursor would bounce around near the hand position which would make tracking objects impossible. The side-effects of smoothing are what you're seeing...because multiple frames are averaged to determine position to reduce that jitter, some lag is introduced.  You can try tweaking the values of the TransformSmoothParameters object, but as you turn down smoothing, jitter will increase.  It's finding the happy balance that is key.