||The Leap Motion controller is a tiny device (size: 8cm x 1cm x 3cm) that allows to detect positions and orientations of one or several hands. It can send to a host application hand skeletal tracking data like the position of each bone of a finger or the orientation of the palm of the hand.|
The bones managed by the Leap Motion controller (source: Leap Motion SDK)
The Leap Motion is a tiny controller
The Leap Motion controller is based on an infra-red (IR) detector and is able to detect hands in a 30cm-radius half sphere centered on the Leap Motion device (actually it’s not a real half sphere because the Leap Motion field of view is around 150 degrees).
The Leap Motion device is connected via the USB port and requires the installation of a driver (the driver’s link is available at the end of the article).
The Leap Motion bundle is simple: the controller, two USB cables (a short and a long) as well as a small user’s guide.
The Leap Motion is priced at 90 euros (on the official web site). You can find in real shops like the Fnac in France or MediaMarkt in Switzerland with a more or less similar price.
The interesting thing with the Leap Motion is the SDK (Software Development Kit). The SDK allows to add the support of the Leap Motion to an existing application and is available for Windows, Mac OS X and Linux (32-bit and 64-bit).
A free account is required to download the SDK. The SDK is available for several programming languages: C/C++, C#, Java and Python.
The C++ version of the SDK is perfect for my needs: adding the Leap Motion support to GLSL Hacker. The SDK is simple to use and I quickly coded (see at the end of the article a SDK-based code snippet) a small plugin for Windows and OS X available with GLSL Hacker 0.7.0.2.
To test the Leap Motion plugin, I created a small demo that allows to break a stack of cubes (managed by PhysX) with the tip of the index:
To end up this presentation of the Leap Motion controller, here is a code snippet based on the C++ SDK that shows how to retrieve the position in 3D space of the tip of the index:
#include "Leap.h" Leap::Controller controller; Leap::Frame frame = controller.frame(); Leap::HandList hands = frame.hands(); Leap::FingerList fingers = hand.fingers(); Leap::Finger finger_index = fingers(); Leap::Bone bone = finger.bone(3); Leap::Vector index_tip_position = bone.nextJoint(); ...
This article is also available in french.