The Leap Motion controller (https://www.leapmotion.com/) is a device that allows the tracking of hands and fingers for virtual and augmented reality applications. The plug-in CindyLeap is able to use the Leap Motion controller to track hands and fingers and generate gesture events. For this, it contains three major features.
- Getting raw tracking data from hands and their finger bones. Using
leapdebugprinthandscan be used to print the data returned by
getleaphandsdataon the console in a hierarchic format. This way, the user can interactively explore what data to use.
leapnormalizeposition can be used to normalize a raw position value.
Getting gesture data using
getleapgesturedata. For this to work,
enablegesturesneeds to be enabled when calling
leapdebugprintgesturescan be used to print the data on the console in a hierarchic format.
Finally, the CindyScript application developer may also let the user move and rotate a Cindy3D or CindyGL scene using their hand(s). For this, the functions
getleapmotiontransformhaschangedwere added. In CindyGL, an application developer can use these functions to transform a scene depending on the returned data (for examples please refer to
examples/cindyleap/). In Cindy3D, the transformation data is used automatically to transform the scene if
usehandtransformcdy3dis set to true in
To be able to use the Leap Motion controller together with CindyLeap, the user also needs to install the Leap Motion SDK on their system. The SDK can be found on the website https://developer.leapmotion.com/sdk/v2.
As a first step, in order to use the plugin, at the beginning of the HTML file, the following code needs to be added (possibly with different file paths).
Examples on how to use CindyLeap can be found in the folder
Description: Initializes the Leap Motion controller.
||Whether to enable gesture support (standard: disabled).|
||If this value is set to true, the transform of a Cindy3D scene is multiplied with the hand transform (standard: disabled).|
||Using this variable, the user can specify the sensibility of the Leap Motion controller's rotational tracking. A factor of 2 is the standard value. This is useful in many scenarios, as a hand can't be freely rotated 360° in all directions because of limitations in the human anatomy of the hand wrists. However, if perfect 1:1 tracking (not reinforced) is desired, this factor should be set to 1.|
||Using this variable, the user can specify the sensibility of the Leap Motion controller's translational/positional tracking. A factor of 1 is the standard value. This is especially necessary if the user has created a scene with large coordinates. In this case, movements of the hands might result in too small movements. This factor is also used by
<script id='csinit' type='text/x-cindyscript'> // Initialize Cindy3D or CindyGL ... use("CindyLeap"); initleapmotion(); // ... </script>