Coder Social home page Coder Social logo

leapmotion / leapjs Goto Github PK

View Code? Open in Web Editor NEW
2.0K 190.0 445.0 5.48 MB

JavaScript client for the Leap Motion Controller

Home Page: https://developer.leapmotion.com/leapjs

License: Apache License 2.0

JavaScript 98.53% Makefile 0.21% HTML 0.49% CoffeeScript 0.76%

leapjs's Introduction

What do you think about the future of VR? Take our survey.

LeapJS Logo

Welcome to the Leap Motion JavaScript framework.

Build Status

Leap.loop(function(frame){
  console.log(frame.hands.length);
});

Learn more in the Getting Started Guide, and the API Reference.

Installation

Browser: Download the latest leap.js from our CDN.

Bower: bower install leapjs

Node: npm install leapjs

Examples

Visit developer.leapmotion.com/gallery/category/javascript for the latest examples.

Some more basic examples have also been included in the examples/ directory.

Plugins

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.

Leap.loop({

  hand: function(hand){
    console.log( hand.screenPosition() );
  }

}).use('screenPosition');

Misc

LeapJS includes the vector math library GL-Matrix for your use and convenience. For example, we can easily compute a dot product. See the example and the gl matrix docs for more info.

var dot = Leap.vec3.dot(hand.direction, hand.indexFinger.direction);

Also visit the wiki for how to make plugins, protocol guide, and other stuff.

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

leapjs's People

Contributors

actions-user avatar ajacksified avatar ashleywright avatar barbagallo avatar bingomanatee avatar cabbibo avatar ceg1236 avatar claudiopro avatar coreygrunewald avatar dependabot[bot] avatar gelicia avatar joshbuddy avatar jplbigdata avatar l1fescape avatar leap-famous avatar logotype avatar maxsillslm avatar neptunius avatar pehrlich avatar raimo avatar recursivecpthook avatar robbieongithub avatar rwaldron avatar saschagehlich avatar sfkiwi avatar stutrek avatar syntagmatic avatar tfe avatar wesbos avatar zalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leapjs's Issues

InteractionBox requires dimensions on creation

I'm reading this documentation, but it doesn't seem to line up.

Specifically, it says "The only class you should manually instantiate is the Controller," but it seems that InteractionBox must be initialized manually in order to work. I cannot find any place where it is created in this codebase.

Also, it says "Use the interaction boxes' properties to scale your measurements -- don't hard code these values in your javascript," but the interaction box requires center, size, width, height, and depth to be sent to it (https://github.com/leapmotion/leapjs/blob/master/lib/interaction_box.js#L23). Am I missing something or is the documentation out of sync or what?

The underlying question is: how do I get normalized coordinates to work with?

0.3.0 beta 3 breaks some examples from http://js.leapmotion.com/tutorials/welcome

Hi there

I had a small function on my web page where I detected the amount of fingers in use.

The code was taken from http://js.leapmotion.com/tutorials/gettingFrames#countingFingers

When I updated from 0.2.0 to 0.3.0 this stoped working - the counter is constantly 0.

I also had a "raw data" function - this only shows the first frame when the web page is loaded and no longer updates.I was using a code like this :

 var controller = new Leap.Controller({enableGestures: true});
  controller.on('deviceFrame', function(frame_instance) {
    latestFrame = frame_instance;
    document.getElementById('out').innerHTML = (pausedFrame ? "<p><b>PAUSED</b></p>" : "") + "<div>"+(pausedFrame || latestFrame).dump()+"</div>";
  });

It no longer refreshes when using 0.3.0 beta 3.
Is it fair to suggest that 0.3.0 beta 3 may not cater for some of the code in the Tutorial?

Thanks
Alex

How Soon Is This Library Ready?

Sorry - this isn't really an issue - just a question.

How soon can leap developers confidently use this library? Is it ready?

LeapJS with NodeJS through require statement results in error

This is a similar issue as #26, but it's a different error. Here's my nodejs code:

var Leap = require('leapjs').Leap; //https://github.com/leapmotion/leapjs/issues/26
var controller = new Leap.Controller({});

Getting the following error:

var controller = new Leap.Controller({});
                         ^
TypeError: Cannot read property 'Controller' of undefined
    at Object.<anonymous>
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

My package.json:

  "dependencies": {
    "express": "latest",
    "async": "latest",
    "leapjs": "latest",
    "ws": "latest",
    "underscore": "latest",
    "gl-matrix": "latest"
  }
npm -v
1.3.14

Hand motion output is suspect

With a stationary hand, I get the following values from the Hand motion functions:

Translation: 580, -2535, -147
RotationAngle: 2.54
ScaleFactor: 0

Since the hand isn't moving except for minor trembling these values are highly suspect. By way of comparison, the (believable values) read simultaneously from the Frame object are:
Translation: 0,0,0
RotationAngle: 0
ScaleFactor: 1

Note that the JSON values appear to be correct, at least at a glance, so the problem seems to be in the client library code.

Turning off the WebSocket server decrements the protocol requested on reconnect.

Steps to reproduce:

. Use code such as the following to print out the current protocol:

var controller = new Leap.Controller({enableGestures:true});
controller.connect();

controller.on('protocol', onProtocol);
function onProtocol(protocol)
{
    console.log("Protocol event: " + protocol.version);
}

. Start the JS App and observe the console. The log should list version 4 or 5.

. Open the Leap Motion Settings panel.

. Uncheck "Allow Web Apps"

. Click Apply

. Check "Allow Web Apps"

. Click Apply

. Observe the log. The protocol version is one less than before.

. Repeat if desired.

Possibly the Leap.js library is assuming a protocol failure is responsible for the refused connection and decrementing the requested protocol in an attempt to get a successful connection. However, that's not what is happening, so the logic should be improved.

Head detection/filtering

Using the leap device while standing up or simply leaning forward often mistake head/nose for valid hand frames. This is causing noise and jittery especially for multiple hand gestures. I feel like the interaction box is half the solution to it but it's not bullet-proof.

However I do notice in the head-triggered frames, those false hand objects have "r" attribute as an identity matrix (probably a default) while they are marked as valid, I'm not sure what this "r" attribute actually is but I'm currently using this as head detection check.

Can it be supported in the core leap.js lib that false alerts are filtered or invalidated?

Clarify Usage of Flash Polyfill for Websockets

There doesn't seem to be any documentation for this outside of the error strings for it inside of Leap.js; if the polyfill works, I think it would be beneficial to mention in your readme that it exists, and provide a quick example of how to set it up.

In particular, I'm stuck on the idea of the Flash policy file. Every example of this I've found thus far shows that in order for Flash to make socket connections, it must receive a policy file from the server it's attempting to connect to. Since LeapJS is connecting to localhost for device information rather than a web server, I'm not sure how the policy file is meant to be delivered.

Thanks!

Problem with node detection in controller.js

Controller() is checking process.title to determine if it's running under node. This isn't reliable (it's failing in Windows). I don't think there is a completely accurate way to do this check. It should probably be an optional parameter or included in the opts object.

Why underscore is a devDep in package.json?

Hello,

I'm wondering why underscore is a dev dependency in packge.json??

In base_connection.js you require it, so underscore should be a dependency and not a dev dep.

Regards,

Xavier

Wrong frame passed to Gesture event emitter

[Edited and retitled with a more precise description of the problem]

After adding a gesture event callback to a Controller object, the callback is invoked multiple times for the same event/frame. (Only happens with swipes and circles; taps seem fine.) What appears to be happening is that the frame passed to the onGesture callback is the latest frame, not the frame to which the gesture object belongs. This makes it difficult to access finger positions, etc. at the time of the gesture update.

var controller = new Leap.Controller({enableGestures:true});
controller.connect();

controller.on('gesture', onGesture);
function onGesture(gesture,frame)
{
    console.log(gesture.type + " with ID " + gesture.id + " in frame " + frame.id);
}

Expected behavior is that the frame passed to the callback is the frame in which a specific gesture update occurred -- not the latest frame.

requestAnimationFrame shim does not work in Firefox

The anonymous function that is used to shim window.requestAnimationFrame does not have a return statement, in leap.js, line 6793, git version of August 7.

It does have the return in the version loaded from //js.leapmotion.com/0.2.0/leap.js.
Because of the missing return, no value is assigned to window.requestAnimationFrame in Firefox, and things don't work.

How to detect swipe direction ?

Hi All,

I calculate the (position[0] - starrPosition[0]) value and use it to determine swipe direction.

But I think it is not enough precision.

So do you have any good idea to help me ?

Invalid object implementation is incomplete

The concept of the Invalid object is that you can always access a property multiple steps down the model hierarchy without running into undefined object errors. Invalid objects are fully formed, but have 0 or identity property values (as appropriate).

For example, if I am averaging the velocity of a finger over the last 100 frames, the following should work, even if there aren't 100 frames in the history cache, or if some of those frames don't include a finger with the specified ID:

<p>Average V: <span id="av">…</span></p>
<script>
var outputDisplay = document.getElementById("av");

var controller = new Leap.Controller();
controller.on('frame', function(frame){
    var averageVelocity = Leap.vec3.create();
    var count = 0;
    if(frame.pointables.length > 0)
    {
        var pointableID = frame.pointables[0].id;
        for( f = 0; f < 100; f++)
        {
            var velocity = controller.frame(f).pointable(pointableID).tipVelocity;
           Leap.vec3.add(averageVelocity, velocity, averageVelocity);
            count++;
        }
    }
    if(count > 0) Leap.vec3.scale(averageVelocity,averageVelocity, 1/count);
    outputDisplay.innerText = "(" + averageVelocity[0].toFixed(2) + ", "
                            + averageVelocity[1].toFixed(2) + ", "
                            + averageVelocity[2].toFixed(2) + ")";
});
controller.connect();

However, I have to check whether the pointable is valid or the velocity is undefined:

 if(controller.frame(f).pointable(pointableID).valid) Leap.vec3.add(averageVelocity, velocity, averageVelocity);

(Yes, this is a contrived example, since I would only want to average valid pointables, but it does illustrate the issue.)

The incomplete implementation exists in the Pointables class, but may also be the case in other classes as well.

Uncaught TypeError: Object [object global] has no method 'requestAnimFrame'

After calling controller.connect(); I get a no method error:

 Uncaught TypeError: Object [object global] has no method 'requestAnimFrame' @ controller.js:90

I see you're using a requestAnimationFrame helper, for some reason it's not being made available on my window object. I'm pulling leapjs into node which I'm running using beefy.

This is all I have right now;

var createEngine = require('voxel-engine'),
    skin = require('minecraft-skin'),
    Leap = require('leapjs'),
    game,
    container;

//setup game world
game = createEngine({
    generate: function(x, y, z) {
        return (Math.sqrt(x*x + y*y + z*z) > 20 || y*y > 10) ? 0 : (Math.random() * 2) + 1;
    },
    texturePath: './textures/',
    materials: ['dirt', 'grass']
});
container = document.querySelector('#world');
game.appendTo(container);

//start leap controller
controller = new Leap.Controller();

controller.on('connect', function() {
    console.log("[Leap] Successfully connected.");
});

controller.connect();

my html file is like so:

<html>
  <head>
    <title>Leap World</title>
  </head>
  <body>
    <div id="world"></div>
    <script type="text/javascript" src="world.js"></script>
  </body>
</html>

I'm then running beefy like so.... beefy world.js 8080

//note
If i replace your calls to the requestAnimationFrame wrapper in controller.js with the standard method for chrome, everything works perfectly.

Your help is greatly appreciated.
Thanks

Typo in Getting Started

http://js.leapmotion.com/start

misses two closing brackets:

controller.on('deviceConnected', function() {
  console.log("A Leap device has been connected.");
};
controller.on('deviceDisconnected', function() {
  console.log("A Leap device has been disconnected.");
};

should read

controller.on('deviceConnected', function() {
  console.log("A Leap device has been connected.");
});
controller.on('deviceDisconnected', function() {
  console.log("A Leap device has been disconnected.");
});

Gesture Detection?

Using the most recent version of leap.js, gestures are no longer being detected. Has the syntax for gesture detection been changed or is it simply dysfunctional now?

pin your dependency versions

https://github.com/leapmotion/leapjs/blob/master/package.json#L15
https://github.com/leapmotion/leapjs/blob/master/package.json#L11

I would advise against both of these (and all the other * in the file). What will happen is that in a day, week, month these projects will release major versions or other breaking changes and your project will not longer work. It will be hard to track down what broke and when. Users of previous versions of your lib will be constantly getting different versions of ws and developers will all get different versions of the devdeps making it harder to have consistent development environment.

Controller has no method named onFrame

Using the 'Do-it-yourself loop':

var controller = new Leap.Controller();
controller.onFrame(function() {
console.log("hello")
console.log(controller.frame().id)
console.log(controller.frame().fingers.length)
console.log(controller.frame().finger(0))
})
controller.connect()

Controller.onFrame produces : Uncaught TypeError: Object [object Object] has no method 'onFrame'

Motion Documentation

Document the Motion object, such as a basic example using rotationAxis and rotation Angle.

Improve Leap Motion device detection APIs

It is overly complicated to handle all the edge-cases for seeing if a Leap Motion controller is connected or not.

There are two main aspects to this problem:

  1. Detecting whether a device is connected:

There is no Controller.isConnected property (as exists in other versions of our API). Likewise, the deviceConnected event is not dispatched if the Leap Motion device is already plugged in when the app starts up.

This means the only reliable way to detect the device at startup is to look for valid frames. Yet, you also need to use deviceConnected and deviceDisconnected events to handle subsequent loss and reconnection. Thus to be robust, your app probably needs two code paths for detection -- one for the startup case and one for reconnection case. Also, adding code to the on frame event handlers should be avoided since these callbacks are invoked a lot, so their is an efficiency aspect as well.

Dispatching an initial deviceConnected event as soon as we know there is a connected Leap Motion Controller device would simplify the app logic required to detect the presence of a Leap device.

  1. Detecting that that a device is not connected.

Since a connection is asynchronous and may not ever be successful, a timeout is required if an app wants to take some action when there is no Leap available (like prompt the user that they need one to use the app). Currently, an app developer has to create their own timeout, but we could simplify things by adding our own inside the connect() function and dispatching a relevant event.

This API could look like:
Add an optional timeoutInterval parameter to Controller.connect

Controller.connect(timeoutInterval = 0);

If the interval is 0, then no timeout is used, otherwise, a connectionTimeout event is dispatched if the device isn't connected within the specified number of milliseconds. It would be helpful to distinguish between the cause being the socket connection or the physical device.

Also, deviceDisconnected is not dispatched when the service is shut down and probably should be so that developers only have to deal with one event if they specifically only care about whether they can get data from the device.

x,y,z properties on Vector are undefined

Maybe doc should be updated as theses properties are not yet available under Leap.Vector?

User has now to use vector[0] instead of vector.x, anyone can confirm?

Gestures won't work until I start Leap's visualizer

Hi,

This seems related to #42.
I have the exact same issue described, even on your online demo.
Swipe gestures only happen once in a while.

But, if I open Leap's visualizer and let it run in the background, it works like a charm.
I've tested it with several version of leapjs, and the behavior is always the same. So I guess this is a quite old issue.

I must precise that I only have Leap's software installed, no additional sdk.

Screen API data in Javascript?

I don't see any Screen API information in the raw JSON data. I've got a v6 device and v0.7.3 software. Has it not been implemented in Javascript yet?

Add Travis CI?

Everybody would benefit from a continuous integration. Travis perfectly fits into GitHub, pull requests are automatically tested, you can instantly see the build status etc.

Websocket Not defined after set process.title

If process.title is set, then it throws.

ReferenceError: WebSocket is not defined
at [object Object].Connection.setupSocket (/home/nstal/workspace/leap-mouse/node_modules/leapjs/lib/connection.js:5:20)
at [object Object].BaseConnection.connect (/home/nstal/workspace/leap-mouse/node_modules/leapjs/lib/base_connection.js:82:22)
at [object Object].Controller.connect (/home/nstal/workspace/leap-mouse/node_modules/leapjs/lib/controller.js:85:23)
at Object. (/home/nstal/workspace/leap-mouse/main.coffee:106:11, :177:14)
at Object. (/home/nstal/workspace/leap-mouse/main.coffee:1:1, :179:4)
at Module._compile (module.js:456:26)

Config settings

Hello,
is there a way to change the configuration setting ?
For instance, I should change the swipe gesture min velocity

Thanks !

RotationMatrix Function Bug?

When calling rotationMatrix(fromFrame), it then calls transposeMultiply(), which passes in "this" and "fromFrame" as the currentFrame and pastFrame respectively. If you follow these vars through to the transpose function (specifically line 1199), you'll find that the frame references a matrix that doesn't exist directly under the frame object, and thus throws an error.

I've found that if you actually pass in this.rotation and fromFrame.rotation to transposeMultiply() that the data is clean.

Please let me know if I'm doing anything incorrectly.

Obtaining Hand Pitch, Yaw and Roll using JavaScript

Using the Leap Motion API for Java you can obtain pitch, yaw and roll of a hand using the following calls:

// hand is a Leap::Hand object
float pitch = hand.direction().pitch();
float yaw = hand.direction().yaw();
float roll = hand.palmNormal().roll();

What is the best (or even just a good) method for obtaining the same values in JavaScript?

Switch to grunt instead of make.

Hey,

I think it would be a great idea since make is not very popular in the Web community. grunt is. You could easily port every task of your Makefile to a Gruntfile.js.

CircularBuffer Implementation is faulty.

The CircularBuffer implementation is referencing this.length which has no value and always returns an Invalid Frame.

try this instead.

exports.CircularBuffer = function(size) {
    this._buf = new Array(size);
    this.pos = 0;
}
CircularBuffer.prototype.get = function(i) {
    if (i == undefined) i = 0;
    if (i > this._buf.length) return null;
    return this._buf[i % this._buf.length];
};

CircularBuffer.prototype.push = function(o) {
    this._buf[this.pos % this._buf.length] = o;
    this.pos++;
};

Optimization issues with r.js

Hi!

I'm running into troubles optimizing leap.min.js with r.js and I'm not quite sure if it's a problem with leapjs or requirejs. Everything runs fine during development until I build a minified version.

I've opened an issue and uploaded an example to try out. Hopefully you can help me to resolve my problem. :)

How to filter the unintentional gesture ?

Hi,

Sometimes leap motion send two same swipe gestures data but I only do one.

Maybe I guess, hand has a stop time (event thought it is very short ) when moving (ID: swipe_1) and leap motion treats this moving as new swipe again (so it tells there is a new swipe gesture in new frame, and it is named ID: swipe_2).

My website supports navigation with leap motion , and as long as get swipe left , it back to history page.

So the problem is when user swipe one time, the website maybe back 2 times. this is not user want.

I also know it is not leap motion problem but I just want to solution or help.

Thanks.

Which Branch is the Canonical Branch?

The repo at leapmotion/leapjs has 23 branches and the repo at leapmotion/js.leapmotion.com has two branches. There seems to be duplication of files among these.

Also the GitHub says about the gh-pages branch: "This branch is 49 commits ahead and 387 commits behind master".

It would be nice to update and tweak the examples a bit, but I am not certain where to begin. Any suggestions?

Frame event never fires in v0.3 node.js example

I unboxed my device today and went through the documented steps to access it from node.js. That is, I cloned the v0.3.0-beta2 repo and did something like

cd leapjs-master
npm install
node examples/node.js

The node example then runs successfully and connect, ready, and protocol events all fire normally. However, frame events never fire, and if I poll for them manually they all come back invalid.

If I then do all the previous steps with the v0.2.2 repo, valid frame events fire as expected. Web-based examples also work normally.

Is the v0.3 just broken for node, or is there something I can do about this?

Clarify node/API usage?

Installed the npm package and just curious how to test the API sans browser.

require('leapjs'); gets me ...

/usr/local/lib/node_modules/leapjs/leap.js:3949
})(this, document);
         ^
ReferenceError: document is not defined
    at Object.<anonymous> (/usr/local/lib/node_modules/leapjs/leap.js:3949:10)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/jvoigt/Code/leap/Demos/sandbox/simple.js:1:63)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)

Math library considerations

In a separate issue (#91) @neptunius mentions:

@joshbuddy removed the Vector and Matrix classes in commit 25d803b to introduce gl-matrix, a high-performance math library, so we don't have to maintain our own. As @theo-armour noticed, it lacks some convenience functions in our homebrew math library that @deckar01 ported from LeapMath.h (C++) to JavaScript. If we want to bring those back, we can revive Jared's implementations and convert them to be compatible with vec3 and mat3 types provided by gl-matrix. Josh and I think it would be best to do this in a separate library to keep the LeapJS client library lean. However, there are likely other vector math utility libraries out there already, maybe one built on gl-matrix, that we can use instead of doing it all ourselves. Let's use existing libraries whenever possible!

The following are thoughts and conasiderations regarding the search for a math library that would help complete Brandon Jone's gl-matrix.

Here is good place to start when looking for JavaScript libraries:

http://jster.net/

Most of the 21 math libraries listed relate to stats, big data and other general math requirements.

The physics and game engine sections might also lead to some finds. Physijs - one of the most popular is an add-on the Three.js.

In the WebGL section, glMatrix is one of the libraries listed.
https://github.com/toji/gl-matrix/tree/master/src/gl-matrix

The following are links to some of the math libraries that I have founded embedded in the various webGL apps:

GLGE
https://github.com/supereggbert/GLGE/blob/master/src/core/glge_math.js

  • by one of the good guys: Paul Brunt

Curve3D
https://github.com/sunetos/curve3d/blob/master/src/math.js

SpiderGL
https://github.com/dibenedetto/SpiderGL/blob/master/src/math.js

C3DL
https://github.com/cathyatseneca/c3dl/tree/master/c3dl/math

Glow
https://github.com/empaempa/GLOW/tree/master/src/extras/math

  • much from Three.js

OSG
https://github.com/cedricpinson/osgjs/tree/develop/js/osg

CubicVR
https://github.com/cjcliffe/CubicVR.js/blob/master/source/CubicVR.Math.js

Scene.js
https://github.com/xeolabs/scenejs/blob/V3.0/src/core/math.js

  • based on glMatrix

LightGL
https://github.com/evanw/lightgl.js/tree/master/src

J3D
https://github.com/drojdjou/J3D/tree/master/src/math

PhiloGL
https://github.com/senchalabs/philogl/blob/master/src/math.js

Closure
http://closure-library.googlecode.com/svn/trunk/closure/goog/math/matrix.js

XTK
https://github.com/xtk/X/blob/master/math/

N3D << new kid on block
https://github.com/1Pupik1989/N3D/tree/master/source

Three.js
https://github.com/mrdoob/three.js/tree/master/src/math

Benchmarks
http://jsperf.com/three-gl-matrix-shootout
http://jsperf.com/glmatrix-theejs-vec3-transform/6
http://jsperf.com/comparison-matrix-and-vector-library/9
http://jsperf.com/threejs-glmatrix-transfomr-vec3/5
see also this thread: mrdoob/three.js#3454

Of all these libraries. my gut feeling is that the Three.ls library is the most complete and most actively developed, followed by Scene.js and Philogl. But then again, I am biased.

I very much hope, however, that the Leap Motion does not get tied or even identified with any particular 3D WebGL engine and that example are made using Scene.js and others libraries.

In any case, the code needed to complete the Leap Motion JavaScript library is already out there and available freely both as in beer and liberty. Many of the apps have their math routines all tidy in a single directory. Any and all of the developers would be happy to see their code being used productively in a new way.

My guess is that the majority of young new programmers coming in the Leap Motion arena will use JavaScript. The time to be talking about and sharing code is now...

Please do let your app coders know what what we can do to help

Theo

update url for websocket

around line 440 of leap.js
this.socket = new WebSocket("ws://"+window.location.host+":6437");

I was going to do a pull request to you, but it keeps telling me the entire file has changed, are you using os2 warp to code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.