Home › Forums › Making things with IanniX › Leap Motion
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..
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");
}
}
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |