Leap Motion API类库:Frame

1.Frame

    帧类表示一组在一个单一帧中检测到的手和手指跟踪数据。

    在跟踪范围内,该跳跃可以检测跟踪区域内的手、手指和工具,并将其位置、方向和运动在帧间的跳跃帧速率打印出来

<p>Framerate: <span id="leapFPS">FPS</span></p>
<p>Number of hands: <span id="handCount">Hands</span></p>
<p>Number of pointables: <span id="pointableCount">Pointables</span></p>
<p>Number of tools: <span id="toolCount">Tools</span></p>
<p>Number of fingers: <span id="fingerCount">Fingers</span></p>
<p>Number of gestures: <span id="gestureCount">Gestures</span></p>
<script>var controller = new Leap.Controller({
                         enableGestures: true,
                         frameEventName: 'animationFrame'
                         });var fpsDisplay = document.getElementById('leapFPS');
                         var handCountDisplay = document.getElementById('handCount');
                         var pointableCountDisplay = document.getElementById('pointableCount');
                         var fingerCountDisplay = document.getElementById('fingerCount');
                         var toolCountDisplay = document.getElementById('toolCount');
                         var gestureCountDisplay = document.getElementById('gestureCount');
                         controller.on('frame', function(frame){
                                      fpsDisplay.innerText = frame.currentFrameRate;
                                      handCountDisplay.innerText = frame.hands.length;
                                      pointableCountDisplay.innerText = frame.pointables.length;
                                      fingerCountDisplay.innerText = frame.fingers.length;
                                      toolCountDisplay.innerText = frame.tools.length;
                                      gestureCountDisplay.innerText = frame.gestures.length;
                          });controller.connect();
</script>


你可能感兴趣的:(Leap Motion API类库:Frame)