Leap Motion

Home Forums Making things with IanniX Leap Motion

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3286 Reply
    Anonymous
    Guest

    Is there any documentation on how to use LeapMotion with Iannix? I saw the demo on Vimeo and was very impressed, but implementing it is unclear to me..

    #3287 Reply
    IanniX
    Keymaster

    No 🙂 I used LeapOSC (https://github.com/odbol/LeapOSC) and this score :

    var curvePointIndex = 0, previousFinger = false, previousFingerCounter = 50;;
    function onIncomingMessage(protocol, host, port, destination, values) {
    	if(previousFingerCounter <= 0) {
    		if(previousFinger) {
    			if(curvePointIndex > 140) {
    				run("add cursor auto");
    				run("setCurve current lastCurve");
    				run("setPattern current 0 0 1 -1");
    				run("play");
    			}
    			else
    				run("remove lastcurve");
    			previousFinger = false;
    			previousFingerCounter = 50;
    		}
    	}
    	if(destination.startsWith("/hand/0/direction")) {
    		previousFingerCounter--;
    	}
    	else if(destination.startsWith("/hand/0/finger/0/pos")) {
    		if(!previousFinger) {
    			previousFinger = true;
    			curvePointIndex = 0;
    			run("add curve auto");
    			run("setColorHue current " + random(0, 255) + " 255 200 255");
    		}
    		previousFingerCounter = 50;
    		run("setSmoothPointAt current " + (curvePointIndex++) + " " +
    			map(values[0], -200,  200, -5, 5) + " " +
    			map(values[2],  100, -100, -5, 5) + " " + 
    			map(values[1],    0,  300, -5, 5));
    	}
    	else if(destination.startsWith("/hand/0/finger/4")) {
    		previousFinger = false;
    		previousFingerCounter = 50;
    		run("clear");
    	}
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Leap Motion
Your information:





© IanniX Association

What is IanniX? | Download | Showcase | Forums | Research | About