Motions

The Leap Motion software analyzes the overall motion that has occurred since an earlier frame and synthesizes representative translation, rotation, and scale factors. For example, if you move both hands to the left in the Leap Motion field of view the frame contains translation. If you twist your hands as if turning a ball, the frame contains rotation. If you move your hands towards or away from each other, the frame contains scaling.

The Leap Motion software uses all of the objects within the field of view when analyzing motion and reports the motion factors in the Frame object. If it only detects one hand, then the Leap Motion software bases the frame motion factors on the movement of that hand. If it detects two hands, then the Leap Motion software bases the frame motion factors on the movement of both hands together. You can also get independent motion factors for each hand from a Hand object.

Motions are derived by comparing the current frame with a specified earlier frame.

Types of Motions

The Leap Motion API provides three types of motions:

  • Translation – linear movement in 3 dimensions.
  • Scale – relative expansion or contraction.
  • Rotation – angular change in 3 dimensions.

You can use the motion factors to manipulate objects in your application’s scene without having to track individual hands and fingers over multiple frames.

Motion Properties

You can get motion factors from Frame objects and Hand objects. The attributes describing the synthesized motion include:

  • Rotation Axis — A direction vector expressing the axis of rotation.
  • Rotation Angle — The angle of rotation clockwise around the rotation axis (using the right-hand rule).
  • Rotation Matrix — A transform matrix expressing the rotation.
  • Scale Factor — A factor expressing expansion or contraction.
  • Translation — A vector expressing the linear movement.