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

proto-object.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]

Web3D/VR

object

proto object


  
  PROTO object [ ## "@vr-extern-object.wrl"
  exposedField SFColor color 0 0 1
  exposedField SFFloat transparency 0
  exposedField SFNode node NULL
  exposedField SFTime cycle 1
  ]{
  DEF time TimeSensor { cycleInterval IS cycle loop TRUE enabled TRUE }
  
  Group {
     children [
        DEF object Transform {
           children [
              DEF shape Shape {
                 appearance Appearance {
                    material Material {
                       diffuseColor IS color
                       transparency IS transparency
                    }
                 }
                 geometry Box {}
              }
           ] }
        Script {
        field SFNode shape USE shape
        field SFNode node IS node
        field SFTime cycle IS cycle
        url "javascript:
        function initialize() {
          if (node) shape.geometry = node;
          if (cycle == 0) time.enabled = FALSE;
        }
        "
        }
     ]
  }
  
  

sensor and interpolator


  
  DEF rotation OrientationInterpolator {
  key [ 0 0.25 0.5 0.75 1 ]
  keyValue [ 1 1 0 0, 1 1 0 1.57, 1 1 0 3.14 1 1 0 4.71, 1 1 0 0 ]
  }
  
  

event routing


  
  ROUTE time.fraction TO rotation.fraction
  ROUTE rotation.value TO object.rotation
  }
  
  

instance


  
  object { }
  


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