Geeks With Blogs
Prabhu Kumar a tech twaddler.. Windows Mobile
Shake detection on HTC HD2
In the previous post I mentioned that the acceleration vector or the force vector can be used to detect gestures like shake. Here is a crude implementation of shake detection, private const double SHAKE_THRESHOLD = 5.0f; private bool IsShakeDetected(HTCSensorData sensorData) { bool isShake = false; double x = (double)sensorData.tiltX / 1000; double y = (double)sensorData.tiltY / 1000; double z = (double)sensorData.tiltZ / 1000; double forceSqrd = x * x + y * y + z * z; System.Console.WriteLine("F... ......

Posted On Saturday, July 24, 2010 5:53 PM

Copyright © TechTwaddle | Powered by: GeeksWithBlogs.net