FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
LeapJS/Examples/tutorial.html at master · deckar01/LeapJS · GitHub
This repository was archived by the owner on May 15, 2019. It is now read-only.
deckar01
/
LeapJS
Public archive
Notifications
You must be signed in to change notification settings
Fork
23
Star
123
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
LeapJS
/
Examples
/
tutorial.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (33 loc) · 1.14 KB
Breadcrumbs
LeapJS
/
Examples
/
tutorial.html
Copy path
File metadata and controls
42 lines (33 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
>
<
body
>
<
script
src
="
../Leap.js
"
>
</
script
>
<
script
>
// Create a controller to connect to the Leap Motion
myController
=
new
Leap
.
Controller
(
"ws://localhost:6437/"
)
;
// Create a listener
myListener
=
new
Leap
.
Listener
(
)
;
// Listener.onFrame is called each time a frame is received
myListener
.
onFrame
=
function
(
controller
)
{
var
frame
=
controller
.
frame
(
)
;
var
hands
=
frame
.
hands
(
)
;
var
pointables
=
frame
.
pointables
(
)
;
var
gestures
=
frame
.
gestures
(
)
;
// Awesome code goes here
}
// Add the listener to the controller
myController
.
addListener
(
myListener
)
;
// Enable the screenTap gesture
myController
.
enableGesture
(
"screenTap"
,
true
)
;
// Listener.onConnect is called when the connection is open
myListener
.
onConnect
=
function
(
controller
)
{
// Calibrate the screen
calibrate
=
new
Leap
.
Calibrate
(
myController
)
;
calibrate
.
onComplete
=
function
(
screen
)
{
// Save the screen
// Or access it later with myController.calibratedScreens()[0]
}
}
</
script
>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL