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

web3d-problem-touch.vr

web3d-problem-touch.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]

Web3D/VR

touchsensor

monitor


  
  #@proto @vr-extern-monitor.wrl
  
  

group


  
  Group {
  children [
  
  DEF message monitor { translation 2 2 0 string "wait"  }
  
  DEF touch TouchSensor {}
  
  DEF script Script {
  directOutput TRUE
  eventIn SFVec2f feel
  field SFNode message USE message 
  field SFNode touch USE touch 
  url "javascript:
  function feel(value) {
          str_x = 'x: ' + value.x;
          str_y = ' y:' + value.y;
          str = str_x + ' ' + str_y;
          print(str);
          message.string = new MFString(str_x,str_y);
          }
          "
  }
  
  

shape


  
          Shape {
                     geometry Box { } ## default
                     appearance Appearance {
                          texture MovieTexture {
                                  loop TRUE
                                  url "@logo.gif"
                          }
                  }
             }
  ]
  
  ROUTE touch.hitTexCoord_changed TO script.feel
  }
  
  

scene


  
  
  Viewpoint { position 0 0 10 }
  
  


(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.