UNPKG

threex

Version:

Game Extensions for three.js http://www.threejsgames.com/extensions/

28 lines 796 B
<html> <head> <title>Dumper - Leap</title> <script src="../vendor/leap.js"></script> <script> var pausedFrame = null; var latestFrame = null; window.onkeypress = function(e) { if (e.charCode == 32) { if (pausedFrame == null) { pausedFrame = latestFrame; } else { pausedFrame = null; } } }; var controller = new Leap.Controller({enableGestures: true}); controller.loop(function(frame) { latestFrame = frame; document.getElementById('out').innerHTML = (pausedFrame ? "<p><b>PAUSED</b></p>" : "") + "<div>"+(pausedFrame || latestFrame).dump()+"</div>"; }); </script> </head> <body> <div id="out"></div> <div id="log"></div> </body> </html>