O'Reilly logo

Leap Motion Development Essentials by Mischa Spiegelmock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating rotation

Now, we should start animating and rendering things. In a perfect world we could perform our own window.requestAnimationFrame() calls, fetching the latest Leap data frames with controller.frame() and repainting the Three.js scene, but at present such a setup is impossible to test due to the incomplete state of the LeapJS library.

Our demonstration integration with Three.js and LeapJS will be simplicity itself; we'll rotate our cute lil' unit cube according to the user's hand rotation. When new hand tracking updates come in from the controller, we'll rotate the cube according to the palm normal of the first returned hand.

A normal is like a ray projecting outward from a surface, representing its orientation. The palmNormal property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required