Track relative motion of fingers : Leapmotion

Please refer the code available at the link above.
I wanted to track finger-tips independently. But when I tried using ‘specific finger’ part of the code, i notices that the PVector values were changing even if I move my palm. Which means, it returns the independent position of fingertips in 3d space. But what if I have to track finger position with respect to the palm?

I’m trying to be sure that I understand the question. Are you asking how to subtract the finger.getPosition from the hand.getPosition, using PVector.sub()?

https://processing.org/reference/PVector_sub_.html

Yes. But not always. It should know when the palm is moving and when the fingers are moving.

Well, that is what subtracting the hand.getPosition does. It expresses the finger as relative to the hand. Then, if the hand moves but the fingers (relative) don’t… they don’t. Because you are subtracting the hand, so nothing is moving.

yes. that is okay if you have to do any one movement at a time. I wanted to track the finger tips simultaneously. Will that be possible?

Well, you should try it and see if it works!

RelativeFinger1 = AbsoluteFinger1 - Palm
RelativeFinger2 = AbsoluteFinger2 - Palm
RelativeFinger3 = AbsoluteFinger3 - Palm