Currently leapmotion.pd does not let you know if the hand is a right or
left one. This abstraction tries to work around this limitation, but
does not fully eradicate it. It ultimately is a quirk, because the SDK
should be able to know if it is a right or left hand because of the
thumb position. However this information isn not available from within
leapmotion.pd

The abstraction has two modes which switch depending on how many hands
are in the field of view:

1 one hand becomes present: will check if the hand appeared on the right
or the left side from the zenith above the device. Assuming that it is
the right hand if it appeared on the right side. You can then use the
full space with that hand and it will keep its designation.

Catch: make sure to initialize correctly and always approach the device
with the right hand from the right and the left hand from the left.

2 two hands present: will check which of the two hands is rightmost and
defines that as the right one.

Catch: never cross hands.
#N canvas 836 153 997 846 10;
#X obj 119 75 inlet;
#X obj 119 777 outlet;
#X obj 482 164 route 0 1;
#X obj 656 97 inlet;
#X obj 781 101 inlet;
#X obj 713 773 outlet;
#X obj 781 772 outlet;
#X obj 656 136 route hand;
#X obj 146 118 unpack f f f f f f;
#X obj 119 98 t a a;
#X obj 304 721 list prepend hand;
#X obj 304 746 list trim;
#X obj 329 233 route palm_position;
#X obj 534 237 route palm_position;
#X obj 329 262 unpack f f f;
#X obj 534 265 unpack f f f;
#X obj 302 211 t a a;
#X obj 303 666 list prepend 0;
#X obj 493 667 list prepend 1;
#X obj 507 197 t a a;
#X obj 507 564 list prepend right;
#X obj 303 564 list prepend left;
#X obj 303 631 route left right;
#X msg 371 526 right;
#X msg 580 529 right;
#X msg 542 529 left;
#X msg 332 526 left;
#X obj 371 464 t b b;
#X obj 332 464 t b b;
#X obj 303 604 list trim;
#X obj 303 700 list trim;
#X obj 188 144 t f f;
#N canvas 320 682 450 300 changeDetect_0to1 0;
#X obj 80 70 inlet;
#X obj 79 170 > 0;
#X obj 79 191 change;
#X obj 79 211 sel 1;
#X msg 79 132 0;
#X msg 107 133 1;
#X obj 79 234 del 0;
#X obj 79 95 sel 0 1;
#X obj 79 263 outlet;
#X connect 0 0 7 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 8 0;
#X connect 7 0 4 0;
#X connect 7 1 5 0;
#X restore 215 172 pd changeDetect_0to1;
#N canvas 1 55 450 300 oneHandCheck 1;
#X obj 106 52 inlet;
#X obj 219 52 inlet;
#X obj 112 182 outlet;
#X obj 238 189 outlet;
#X obj 171 90 > 0;
#X obj 156 122 f;
#X obj 156 149 sel 0 1;
#X connect 0 0 5 0;
#X connect 1 0 4 0;
#X connect 4 0 5 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 6 1 3 0;
#X restore 242 313 pd oneHandCheck;
#N canvas 1219 550 272 349 twoHandCheck 1;
#X obj 40 47 inlet;
#X obj 88 47 inlet;
#X obj 136 47 inlet;
#X obj 40 280 outlet;
#X obj 94 281 outlet;
#X obj 40 147 f;
#X obj 40 183 sel 0 1;
#X obj 88 97 >;
#X obj 40 96 sel 2;
#X connect 0 0 8 0;
#X connect 1 0 7 0;
#X connect 2 0 7 1;
#X connect 5 0 6 0;
#X connect 6 0 3 0;
#X connect 6 1 4 0;
#X connect 7 0 5 1;
#X connect 8 0 5 0;
#X restore 188 418 pd twoHandCheck;
#X obj 329 289 t f f;
#X connect 0 0 9 0;
#X connect 2 0 16 0;
#X connect 2 1 19 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 7 0 2 0;
#X connect 7 1 5 0;
#X connect 8 2 31 0;
#X connect 9 0 1 0;
#X connect 9 1 8 0;
#X connect 10 0 11 0;
#X connect 11 0 5 0;
#X connect 12 0 14 0;
#X connect 13 0 15 0;
#X connect 14 0 35 0;
#X connect 15 0 34 2;
#X connect 16 0 21 0;
#X connect 16 1 12 0;
#X connect 17 0 30 0;
#X connect 18 0 30 0;
#X connect 19 0 20 0;
#X connect 19 1 13 0;
#X connect 20 0 29 0;
#X connect 21 0 29 0;
#X connect 22 0 17 0;
#X connect 22 1 18 0;
#X connect 23 0 21 1;
#X connect 24 0 20 1;
#X connect 25 0 20 1;
#X connect 26 0 21 1;
#X connect 27 0 23 0;
#X connect 27 1 25 0;
#X connect 28 0 26 0;
#X connect 28 1 24 0;
#X connect 29 0 22 0;
#X connect 30 0 10 0;
#X connect 31 0 34 0;
#X connect 31 1 32 0;
#X connect 32 0 33 0;
#X connect 33 0 28 0;
#X connect 33 1 27 0;
#X connect 34 0 28 0;
#X connect 34 1 27 0;
#X connect 35 0 33 1;
#X connect 35 1 34 1;
#N canvas 771 172 632 556 10;
#X obj -171 320 leapmotion-rightlefthand;
#X obj -171 106 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj -171 42 tgl 30 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj -171 80 metro 50;
#X msg -115 80 info;
#X obj -171 165 leapmotion;
#N canvas 407 57 450 300 hands 0;
#X obj 169 75 unpack 0 0 0 0 0 0;
#X floatatom 163 119 5 0 0 0 hands - -, f 5;
#X obj 169 49 inlet;
#X connect 0 2 1 0;
#X connect 2 0 0 0;
#X coords 0 -1 1 1 120 40 1 100 100;
#X restore -171 405 pd hands;
#X text 69 119 The abstraction has two modes:;
#X text 89 142 1 one hand present: will check if the hand appeared
on the right or the left side and assume that it is the right hand
if it appeared on the right side., f 56;
#X text 89 212 2 two hands present: will check which of the two hands
is rightmost and defines that as the right one., f 56;
#X obj -109 250 t a a;
#N canvas 770 672 450 300 checkhands 0;
#X obj 139 -80 inlet;
#X obj 139 -58 route hand;
#X obj 139 -34 route 0 1;
#X obj 139 8 route palm_position;
#X obj 271 8 route palm_position;
#X obj 139 37 unpack f f f;
#X obj 271 36 unpack f f f;
#X floatatom 126 120 5 0 0 0 h_0 - -, f 5;
#X floatatom 185 121 5 0 0 0 h_1 - -, f 5;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X coords 0 -1 1 1 120 40 1 100 100;
#X restore -2 369 pd checkhands;
#N canvas 770 672 450 300 checkhands 0;
#X obj 139 -80 inlet;
#X obj 139 -58 route hand;
#X obj 139 -34 route 0 1;
#X obj 139 8 route palm_position;
#X obj 271 8 route palm_position;
#X obj 139 37 unpack f f f;
#X obj 271 36 unpack f f f;
#X floatatom 126 120 5 0 0 0 h_0 - -, f 5;
#X floatatom 185 121 5 0 0 0 h_1 - -, f 5;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X coords 0 -1 1 1 120 40 1 100 100;
#X restore 0 286 pd checkhands;
#X text 67 71 Currently leapmotion.pd does not let you know if the
hand is a right or left one. This abstraction tries to work around
this limitation \, but does not fully eradicate it.;
#X connect 0 0 6 0;
#X connect 0 1 11 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 0 0;
#X connect 5 1 10 0;
#X connect 5 2 0 2;
#X connect 10 0 0 1;
#X connect 10 1 12 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to