Web3D/VRML
[] readme course preface 1 2 3 4 5 6 7 reference examples resources

talk show tell print

x-ball-0.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]

bouncing ball (0)

bounce


  
  DEF PLACE Transform {
  scale 0.5 0.5 0.5
  children [ 
  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 SCRIPT Script {   
          directOutput TRUE
          field SFNode place USE PLACE
          field SFFloat position 0
          eventIn SFFloat set_fraction    
          eventOut SFColor value_changed  
          url "javascript:
          function set_fraction(value) {  
                  if (value < 0.5) {
                          position += 0.1;
                          value_changed = '0 1 1';
                  } else {
                          position -= 0.1;
                           value_changed = '1 0 0';
                          }
                  place.translation.y = position;
                  }
                  "
          }#<l++>
  

routing


  ROUTE TIME.fraction_changed TO SCRIPT.set_fraction
  ROUTE SCRIPT.value_changed TO MATERIAL.diffuseColor
  
  
  
  Viewpoint { position 0 0 20 }
  Background { skyColor 1 0.2 0.2 }
  
  


[] readme course preface 1 2 3 4 5 6 7 reference examples resources
eliens@cs.vu.nl

draft version 0.3 (17/9/2001)