Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leapmotion/leapjs
JavaScript client for the Leap Motion Controller
https://github.com/leapmotion/leapjs
Last synced: 28 days ago
JSON representation
JavaScript client for the Leap Motion Controller
- Host: GitHub
- URL: https://github.com/leapmotion/leapjs
- Owner: leapmotion
- License: apache-2.0
- Created: 2013-01-04T22:13:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-08-02T12:14:02.000Z (over 1 year ago)
- Last Synced: 2024-04-14T22:44:17.814Z (7 months ago)
- Language: JavaScript
- Homepage: https://developer.leapmotion.com/leapjs
- Size: 5.35 MB
- Stars: 1,994
- Watchers: 190
- Forks: 446
- Open Issues: 88
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
__What do you think about the future of VR? [Take our survey.](https://www.surveymonkey.com/s/7LZQDKL)__
[![LeapJS Logo](https://cloud.githubusercontent.com/assets/407497/2652512/eedfb992-bfae-11e3-8323-f202845e3fd8.png)](https://developer.leapmotion.com/leapjs/)
Welcome to the [Leap Motion](https://www.leapmotion.com) JavaScript framework.
[![Build Status](https://travis-ci.org/leapmotion/leapjs.svg)](https://travis-ci.org/leapmotion/leapjs)
```javascript
Leap.loop(function(frame){
console.log(frame.hands.length);
});
```Learn more in the [Getting Started Guide](https://developer.leapmotion.com/leapjs/getting-started), and the [API Reference](https://developer.leapmotion.com/documentation/javascript/api/Leap_Classes.html).
### Installation
**Browser**: Download the latest `leap.js` [from our CDN](https://developer.leapmotion.com/leapjs/welcome).
**Bower**: `bower install leapjs`
**Node**: `npm install leapjs`
### Examples
Visit [developer.leapmotion.com/gallery/category/javascript](https://developer.leapmotion.com/gallery/category/javascript) for the latest examples.
Some more basic examples have also been included in the [examples/](https://github.com/leapmotion/leapjs/tree/master/examples) directory.
### Plugins
[Plugins](http://developer.leapmotion.com/leapjs/plugins) are used to modularly extend Leap Webapps with external libraries.
Here we use the `screenPosition` plugin to get the position of the hand as an on-screen cursor.```javascript
Leap.loop({hand: function(hand){
console.log( hand.screenPosition() );
}}).use('screenPosition');
```### Misc
LeapJS includes the vector math library [GL-Matrix](http://glmatrix.net/) for your use and convenience. For example, we can easily compute a dot product. See [the example](https://github.com/leapmotion/leapjs/blob/master/examples/math.html) and [the gl matrix docs](http://glmatrix.net/docs/2.2.0/) for more info.
```javascript
var dot = Leap.vec3.dot(hand.direction, hand.indexFinger.direction);
```Also visit the wiki for [how to make plugins](https://github.com/leapmotion/leapjs/wiki/Plugins),
[protocol guide](https://github.com/leapmotion/leapjs/wiki/Protocol), and [other stuff](https://github.com/leapmotion/leapjs/wiki).### Contributing
Add your name, email, and github account to the CONTRIBUTORS.txt list, thereby agreeing to the terms and conditions of the Contributor License Agreement.
Open a Pull Request. If your information is not in the CONTRIBUTORS file, your pull request will not be reviewed.
[![Analytics](https://ga-beacon.appspot.com/UA-31536531-10/LeapJS/README.md?pixel)](https://github.com/leapmotion/LeapJS)