More Related Content
Similar to Leap motion (8)
More from Kindai University (20)
Leap motion
- 4. 原理は謎
新 Kinect : Time of Flight法
★TOFカメラはとても高価
Microsoft だから力技で低価格化できたけど
ベンチャーには、無理、無理
TOFカメラ
- 8. サンプルコード
<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8><title>leap2.html</title></head>
<body>
<h1>手の数:<span id="h"></span></h1>
<h1>指の数: <span id="p"></span></h1>
<h1>Translation: <span id="t"></span></h1>
<h1>Scaling: <span id="s"></span></h1>
</body>
<script src="leapjs/leap.js"></script>
<script>
var lastFrame = {};
Leap.loop(function(obj) {
document.getElementById("h").innerHTML = obj.hands.length;
document.getElementById("p").innerHTML = obj.pointables.length;
document.getElementById("t").innerHTML = obj._translation;
document.getElementById("s").innerHTML = obj._scaleFactor;
});
</script></html>