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

proto-slide-backgrounds-snow.vr

proto-slide-backgrounds-snow.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  

snow

Web3D/VR

HUD


  
  Transform {
  translation 0 0 15 
  children [
  
  Transform {
      translation  0 4 -35
      scale        3 3  3
  
     children [
          # 1 shape as child node
          Shape {
             appearance Appearance {
                 material Material {
                     diffuseColor  1 1 1
                     emissiveColor 1 1 1
                 }
             }
              geometry PointSet {
                # declare some points (x,y,z)
                  coord DEF PointBoxCoords Coordinate {
                     point [ ]
                  }
             }
        }
     ]
  }
  
  DEF AnimationTimer TimeSensor { 
     startTime 0                # Start immediately
     cycleInterval 20     # One timing loop takes 20 seconds
     loop TRUE                # Keep on generating timing events
  }
  
  # Script for initializing the box with points at startup
  # and animating them like stars
  DEF PointBoxScript Script {
     eventOut MFVec3f point_changed
     eventIn  SFFloat set_fraction
     # The array of points
     field    MFVec3f point 0.0 0.0 0.0
  
     # Number of points to generate
     field    SFInt32 PointCount 600
     url "javascript:
     function initialize()
     {  
          // Number of points
          point.length = PointCount;
          
          for (i=0; i < PointCount; i++) 
          {  
              point[i].x = (Math.random() - 0.5)*16;
              point[i].y = Math.random() * 8;
              point[i].z = Math.random() * 10;
          }
          // Send the points to the empty geometry
          point_changed = point;
     }
     function set_fraction(value)
     {
        for (i=0; i < PointCount; i++) 
          {  point[i].y = point[i].y - 0.1;
           if (point[i].y < 0) 
              point[i].y = point[i].y + 8;
          }
          // Send the points to the empty geometry
          point_changed = point;
     }
     "
  }
  
  ROUTE PointBoxScript.point_changed TO PointBoxCoords.set_point
  ROUTE AnimationTimer.fraction_changed TO PointBoxScript.set_fraction
  
  ] }
  
  


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