0

I am making a puppet app with the Leap Motion. Whenever I try and get the Yaw of a hand it always seems to be wrong (ie: My hand is flat but it says its at 45 degrees or my hand is flat and it says its at -30 degrees, generally unreliable and jumpy). I use

    Hand hand = frame.hands().get(0);

    palm1Position = hand.palmPosition();

    normal = hand1.palmNormal();
    direction = hand1.direction();

    palmRoll = Math.toDegrees(normal1.roll());
    palmYaw = Math.toDegrees(direction1.yaw());

To get the Roll and Yaw of the hand. The roll works perfectly but the yaw is horrible. This is a problem because marionettes rely heavily on yaw. Any idea why this is happening and how I can fix it?

Mat
  • 202,337
  • 40
  • 393
  • 406
Noah Huppert
  • 4,028
  • 6
  • 36
  • 58

2 Answers2

1

I'm in JavaScript and I don't think we have this yet, but the Java docs say you should have this

float pitch = hand.direction().pitch();
float yaw = hand.direction().yaw();
float roll = hand.palmNormal().roll();

See https://developer.leapmotion.com/documentation/Languages/Java/Guides/Leap_Tracking.html

Theo
  • 376
  • 1
  • 3
  • 13
0

To get the yaw of your hand, why don't get the vector of the middle Finger? Or maybe the average of all the fingers of the hand?

I don't know if the results will be better but I think it can worth testing.

And what is the language you are using? Java?

orion78fr
  • 166
  • 2
  • 8