LeapSample / HandRotationLeap
using System; | |
using System.Windows.Media.Media3D; | |
namespace HandRotationLeap | |
{ | |
public static class Leap3DHelper | |
{ | |
public static Vector3D ToVector3D(this Leap.Vector v) => new Vector3D(v.x, v.y, v.z); | |
// Wrong values. | |
public static EulerAngles GetEulerAngles_org(this Leap.Hand h) => new EulerAngles | |
{ | |
Yaw = h.Direction.Yaw, | |
Pitch = h.Direction.Pitch, | |
Roll = h.PalmNormal.Roll, | |
}; | |
// Improved values. | |
public static EulerAngles GetEulerAngles(this Leap.Hand h) => | |
Rotation3DHelper.ToEulerAngles(-h.Direction.ToVector3D(), -h.PalmNormal.ToVector3D()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
The whole source code is HandRotationLeap (GitHub).