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-discrete-interpolator.vr

web3d-discrete-interpolator.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]

Web3D/VR

discrete interpolator

shape


  Shape  {
          geometry Sphere { radius 2 }
          appearance Appearance {
                  material DEF MATERIAL Material {
                          diffuseColor 1 0 0
                          }
                  }
  }
  

sensor + script


  DEF TIME TimeSensor { loop TRUE cycleInterval 5 } #<l++>
  
  DEF COLORS Script {   
          eventIn SFFloat set_fraction    
          eventOut SFColor value_changed  
          url "javascript:
          function set_fraction(value) {  
                  if (value < 0.5) value_changed = '0 1 1';
                  else value_changed = '1 0 0';
                  }
                  "
          }#<l++>
  
  ROUTE TIME.fraction_changed TO COLORS.set_fraction
  ROUTE COLORS.value_changed TO MATERIAL.diffuseColor
  


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