0

I am trying to create a virtual drum with leap motion. If a stick go fast and changes its direction in a moment (means high acceleration), I will count it as a "hit". The problem is I cannot calculate the acceleration of my tool (stick). I checked official documentation entirely however I did not see any function that finds the acceleration. Is there any method that I can calculate the acceleration of a tool ?

user3079364
  • 171
  • 1
  • 19

2 Answers2

1

You can track acceleration by taking the derivative of the velocity; just be aware that it may be sensitive to error and require some filtering.

0

I like the project of a virtual drum! Anyway, here's how I would do: If you considere the "hit" as a SwipeGesture you can just get the speed of the Gesture and if the speed is faster than your "hit threasold speed" you consider that Swipe as a "hit" on the drum!!! Here's the documentation for the speed of a Swing gesture https://developer.leapmotion.com/documentation/cpp/api/Leap.SwipeGesture.html#cppclass_leap_1_1_swipe_gesture_1a055e9dc8167598af360254f4775a27c9

Andrea Taglia
  • 145
  • 2
  • 11