openni-browser
Server <-> Browser bridge for OpenNI skeleton.
Works with kinect.
Uses Socks.js (via Shoe).
Install
Install libusb and OpenNI following the platform-specific instructions at https://github.com/OpenNI/OpenNI
$ npm install openni-browser
Create Node Server
var kinectSock = ;var ecstatic = __dirname + '/public'; var server = ; kinectSock; server;
Create Client
Copy browser/openni.js
into the public folder.
In your HTML file include that script before the body
close tag:
Inside a browser script:
Initialize connection to the server by providing a full or relative URL:
var skeleton = ;
Listen for user events:
'newuser' 'lostuser' 'posedetected' 'calibrationstart' 'calibrationsuccess' 'calibrationfail';
Listen for joint position changes:
jointNames = "head" "neck" "torso" "waist" "left_collar" "left_shoulder" "left_elbow" "left_wrist" "left_hand" "left_fingertip" "right_collar" "right_shoulder" "right_elbow" "right_wrist" "right_hand" "right_fingertip" "left_hip" "left_knee" "left_ankle" "left_foot" "right_hip" "right_knee" "right_ankle" "right_foot" ; jointNames;
Connection Handling
The skeleton
object will also emit:
connect
— when there is a connection to the serverend
— when the connection to the server is ended
Examples
See the examples
folder.
Licence
MIT