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-video.vr

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


  

template logo

video and text


  
  <image a=@a trans=@pos type=vid src=@video id=@tid-ch-1 color=white w=8.5 h=5 s=3>
  <i><text size=0.5 s=1.8 id=@tid-t-1 text=red>@text1</text> </i>
  <p><text size=0.5 s=1.8 id=@tid-t-2 a=1 text=red>@text2</text>
  <p>
  <3dobject id=@tid-o-1 s=0.5 x=7 y=-1>
  DEF @tid-touch TouchSensor { }
  Shape {
  appearance Appearance  {
  material DEF @tid-MAT Material {
          diffuseColor 1 1 0
          transparency 0.6
          }
  }
  geometry  Box { }
  }
  </3dobject>
  
  

animator


  
  <3dobject>
  DEF @tid-time TimeSensor { cycleInterval 4 loop TRUE }
  
  DEF @tid-script Script {
  directOutput TRUE
  
  eventIn SFTime touch
  eventIn SFTime time
  eventOut SFFloat transparency
  field SFNode video USE @tid-ch-1
  field SFNode text1 USE @tid-t-1
  field SFNode text2 USE @tid-t-2
  field SFNode block USE @tid-MAT
  field MFString string []
  field SFInt32 state 0
  field SFInt32 notify 0
  
  url "javascript:
  function time(value) {
  if (notify==0) {
          notify = 1;
  } else if (notify==1) {
          touch(value);
          notify++;
  } else if (notify==2) {
          touch(value);
          notify++;
          }
  }
  function touch(value) {
  if (state == 0) { 
          string = text1.string;
          text1.string = text2.string[0];
          text1.alpha = 0;
          text2.alpha = 1;
          state = 1;
  } else if (state == 1) {
          text1.alpha = 1;
          block.transparency = 1;
          state = 2;
  } else if (state == 2) {
          text1.string = string;
          text1.alpha = 0;
          block.transparency = 0.6;
          state = 3;
  } else if (state == 3) {
          video.stopTime = value;
          state = 4;
  } else if (state == 4) {
          video.stopTime = 0;
          video.startTime = value;
          state = 0;
          }
  }
          "
  }
  
  ROUTE @tid-touch.touchTime TO @tid-script.touch
  ##ROUTE @tid-time.cycleTime TO @tid-script.time
  
  DEF @tid-time TimeSensor { loop TRUE cycleInterval 5 }
  DEF @tid-colors ColorInterpolator {
  key [ 0 0.5 1 ]
  keyValue [ 0 1 0, 1 0 0  ,1 0 1 ]
  }
  
  DEF @tid-scalar ScalarInterpolator {
  key [ 0 0.5 1 ]
  keyValue [ 0 0.5 1 ]
  }
  
  
  
  
  
  DEF @tid-back ColorInterpolator {
  key [ 0 0.5 1 ]
  keyValue [ 1 1 0, 0 1 0  ,0 1 1 ]
  }
  
  DEF @tid-rotation OrientationInterpolator {
  key [ 0 0.5 1]
  keyValue [ 1 1 0 0, 1 1 0 1.56 , 1 1 0 3.14 ]
  }
  
  
  
  
  
  
  
  ROUTE @tid-time.fraction TO @tid-rotation.fraction
  ROUTE @tid-rotation.value TO @tid-o-1.rotation
  </3dobject>
  </image>
  


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