diff -r 11234537653b -r 92f19af39024 front_processing/src/Trakers/Trakers.pde --- a/front_processing/src/Trakers/Trakers.pde Fri Mar 09 18:15:12 2012 +0100 +++ b/front_processing/src/Trakers/Trakers.pde Thu Mar 15 13:33:21 2012 +0100 @@ -1,4 +1,5 @@ import TUIO.*; +//import TrakersNavierStokes; TuioProcessing tuioClient; boolean oneHandLeft; @@ -8,7 +9,7 @@ void setup() { size (640, 480); - background(255); + showMask(); tuioClient = new TuioProcessing(this, 80); textAlign(CENTER); imageMode(CENTER); @@ -31,14 +32,41 @@ void tuioInput() { noFill(); - rect(0, 0, 50, 50); + //rect(0, 0, 50, 50); Vector tuioCursorList = tuioClient.getTuioCursors(); - + + if(tuioCursorList.size() <= 0) + { + showMask(); + text("Les mains sont trop loin ou trop près.", width/2 - 20, 20); + text("Je ne détecte aucune main.", width/2 - 20, 40); + } + if(tuioCursorList.size() == 1) + { handleOneHand((TuioCursor)tuioCursorList.elementAt(0)); + fill(255); + text("Les mains sont dans la zone de captation.", width/2 - 20, 20); + text("Je détecte une main.", width/2 - 20, 40); + } else if(tuioCursorList.size() == 2) + { handleBothHands(tuioCursorList); + fill(255); + text("Les mains sont dans la zone de captation.", width/2 - 20, 20); + text("Je détecte les deux mains.", width/2 - 20, 40); + } +} + +/*FONCTION DE GENERATION DU MASQUE +Entrée : +Sortie : Place des rectangles autour de la zone de dessin*/ +void showMask() +{ + background(0); + fill(255); + rect(0, 80, width, height-130); } /*FONCTION DE GESTION DES COURBES POUR UNE MAIN DETECTEE @@ -46,9 +74,8 @@ Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/ void handleOneHand(TuioCursor handCursor) { - fill(0, 0, 255); - rect(0, 0, 50, 50); - + showMask(); + Vector pointList = handCursor.getPath(); for (int j=0;j