Leap Motion

Accueil Forums Créer avec IanniX Leap Motion

2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #3286 Répondre
    Anonymous
    Invité

    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 Répondre
    IanniX
    Maître des clés

    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");
    	}
    }
    
2 sujets de 1 à 2 (sur un total de 2)
Répondre à : Leap Motion
Vos informations :





© IanniX Association

Qu'est-ce que IanniX ? | Téléchargement | Showcase | Forum | Recherche | À propos