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

music-dossier-GuidedTour.vr

music-dossier-GuidedTour.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  PROTO GuidedTour
  [
          eventOut SFString showNodeCG
          eventOut SFString showNodePG
          eventOut SFString exit
          eventOut SFString nodeTitle
          eventOut SFBool exitButtons
          eventOut SFBool selectMiddleWindow
          eventOut SFString text
          eventIn SFBool start
          eventOut SFBool MaxMiddleWindow
          eventOut SFBool minimizeWindow
          eventOut SFBool startInitiated
          eventOut SFBool playAudio
          eventOut SFBool exit3Dinstallation
  
  ]
  {
          
  DEF timerGuidedTour TimeSensor {   # world time tracker
          enabled TRUE
          loop TRUE
  }
  
          DEF guidedTourActionScript Script {
                  eventIn SFTime globalTime #timer time - starts when world is loaded
                  field SFTime beginTime 0 # start time touch sensor relative aan world load time (global time)
                  eventIn SFBool start IS        start
                  field SFBool nodeShown_status TRUE
                  field SFTime lastEvent 0
                  field SFBool isActive FALSE
                  eventOut SFString showNodeCG IS showNodeCG # show information node (ID)
                  eventOut SFString showNodePG IS showNodePG # show presentation environment
                  eventOut SFString exit IS exit # exit presentation environment
                  eventOut SFString nodeTitle IS nodeTitle  #show title object in presentation environment
                  eventOut SFBool        exitButtons IS exitButtons # exit presentation environment buttons
                  eventOut SFBool        selectMiddleWindow IS selectMiddleWindow # selection middle window pres. environment.
                  eventOut SFString text IS text # selection text in presentation environment.
                  eventOut SFBool        MaxMiddleWindow IS MaxMiddleWindow
                  eventOut SFBool        minimizeWindow IS minimizeWindow
                  eventOut SFBool        startInitiated IS startInitiated
                  eventOut SFBool playAudio IS playAudio
                  eventOut SFBool        exit3Dinstallation IS exit3Dinstallation
                  
  
                  url "javascript:
                  function start(value,time) { // +/- one second later then global time (examople: global time = 5 min, touch = 5.1 min, 
                          if (value) {
                                  beginTime = time;
                                  isActive = true;
                          }
                          lastEvent = -1;
                  }        
  
                  function globalTime(value) {
                          if (isActive) {
                                  
                                  startInitiated = true;  
                                  
                                  var currentTime = value - beginTime;   // currentime increases, initially always starts at 0 or minus.
                                  
                                  if (nextEvent(currentTime,0) ) {showNodeCG = 'MAIN';}  //shows main node after 0 seconds
                                  if (nextEvent(currentTime,4) ) {showNodeCG = 'PERFORMANCE'; }
                                  if (nextEvent(currentTime,7) ) {showNodeCG = 'SOLOPERFORMER'; } 
                                  if (nextEvent(currentTime,10) ) {showNodeCG = 'BILLYSWAN'; }
                                  if (nextEvent(currentTime,13) ) {nodeTitle = 'BILLY SWAN'; showNodePG = 'BILLYSWAN'; }
                                  if (nextEvent(currentTime,16) ) {playAudio = true;}
                                  if (nextEvent(currentTime,20) ) {selectMiddleWindow = true; }
                                  if (nextEvent(currentTime,22) ) {text = 'TEXTBILLYSWAN'; }
                                  if (nextEvent(currentTime,24) ) {MaxMiddleWindow = true; }
                                  if (nextEvent(currentTime,27) ) {minimizeWindow = true; }
                                  if (nextEvent(currentTime,30) ) {exitButtons = true; exit = 'BILLYSWAN'; }
                                  if (nextEvent(currentTime,34) ) {showNodeCG = 'GUITAR'; }
                                  if (nextEvent(currentTime,38) ) {showNodeCG = 'GUITARINSTALLATION'; }
                                  if (nextEvent(currentTime,42) ) {showNodePG = 'GUITARINSTALLATION'; }
                                  if (nextEvent(currentTime,46) ) {exit3Dinstallation = true; }
                                  if (nextEvent(currentTime,47)) { isActive = false; startInitiated = false;}
                          }
                          else { startText = false;} 
                  }
  
                  function nextEvent(currentTime,eventTime) {
                          
                          if (currentTime > eventTime && lastEvent < eventTime) {
                                  lastEvent = eventTime;
                                  return true;
                          }
                          
                          return false;
                  }
                    "
          }        
          ROUTE timerGuidedTour.time TO guidedTourActionScript.globalTime         
  
  }
  
  


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