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

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

Web3D/VR

traffic light

viewpoint


  
  DEF CAM1 Viewpoint {
          position 0  0  20
          fieldOfView 0.79
          description "Camera 1"
  }
  
  NavigationInfo {
          type "EXAMINE"
  }
  
  

SphereTransform


  
  PROTO SphereTransform [
          exposedField SFVec3f sphereTranslation 0  0  2.0
          exposedField SFColor sphereColor 1 1 1
          exposedField SFFloat sphereRadius 1.5
  ]
  {
          Transform {
                  translation IS sphereTranslation
                  children [
                          Shape {
                                  appearance Appearance {
                                          material Material {
                                                  diffuseColor IS sphereColor
                                          }
                                  }
                                  geometry Sphere {
                                          radius IS sphereRadius
                                  }
                          }
                  ]
          }
  }
  
  

BoxTransform


  
  PROTO BoxTransform [
          field SFRotation boxRotation 0  0  0  0.0
          field SFVec3f boxTranslation 0  0  0
          field SFColor boxColor 1.0  1.0  1.0
          field SFVec3f boxSize 2.0  2.0  2.0
  ]
  {
          Transform {
                  rotation IS boxRotation
                  translation IS boxTranslation
                  children [
                          Shape {
                                  appearance Appearance {
                                          material Material {
                                                  diffuseColor IS boxColor
                                          }
                                  }
                                  geometry Box {
                                          size IS boxSize
                                  }
                          }
                  ]
          }
  }
  
  

TrafficLight


  
  PROTO TrafficLight [
          exposedField SFColor RLight 1.0 1.0 1.0
          exposedField SFColor ALight 1.0 1.0 1.0
          exposedField SFColor GLight 1.0 1.0 1.0
  ]
  {
          

  


  


  

TrafficLight



  

  PROTO TrafficLight [

          exposedField SFColor RLight 1.0 1.0 1.0

          exposedField ë‘|§2|×.html>Transform {
                  rotation 0 1 0 0.6
                  children [
                          BoxTransform {
                                  boxSize 4.0 12.0 2.0
                          }
                          DEF RedLight SphereTransform {
                                  sphereColor IS RLight
                                  sphereTranslation 0.0  4.0  0.8
                          }
                          DEF AmberLight SphereTransform {
                                  sphereColor IS ALight
                                  sphereTranslation 0.0  0.0  0.8
                          }
                          DEF GreenLight SphereTransform {
                                  sphereColor IS GLight
                                  sphereTranslation 0.0 -4.0  0.8
                          }
                  ]
          }
  }
  
  

Red & Amber & Green


  
  PROTO CaseR [ ] {
          TrafficLight {
                  RLight 1.0 0.0 0.0
          }
  }
  
  PROTO CaseA [ ] {
          TrafficLight {
                  ALight 1.0 0.9 0.0
          }
  }
  
  PROTO CaseG [ ] {
          TrafficLight {
                  GLight 0.0 1.0 0.0
          }
  }
  
  

the light (tl)


  
  DEF tl TrafficLight {
  }
  
  


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