media @ VU
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

talk show tell print

template-rif-gesturefilter.vr

template-rif-gesturefilter.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  DEF GESTUREFILTER Script 
  {
      eventIn  MFString lineInput
      eventOut MFString chat
      eventOut SFInt32  gesture
  
      field SFString string ""
      field MFString 
  gestures [ "/G1","/G2","/G3","/G4",
                                "/G5","/G6","/G7","/G8","/G9",
                                "/g1","/g2","/g3","/g4",
                                "/g5","/g6","/g7","/g8","/g9" 
  ]
      field MFInt32  gesture_id [ 1,2,3,4,5,6,7,8,9,
                                  1,2,3,4,5,6,7,8,9  ]
  
      url "javascript:
  
          function findGesture(gesture) 
  {
              g = new String(gesture);
              if(-1 != (index = string.indexOf(g,0))) {
                  if(g.charAt(0) == '/') { // Escape...
                      string = string.substring(0,index) 
  + 
                               string.substring(index+g.length,string.length);
                  }
                  return true;
              }
              return false;
          }
  
          function lineInput(value,time) 
  {
              string = value[0];
              for(i=0;i<gestures.length;i++) {
                  if(findGesture(gestures[i])) { 
                      gesture = gesture_id[i]; 
                  }
              }
   
             chat = string;
          }
      "
  }
  
  


(C) A. Eliëns 21/5/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.