#VRML V2.0 utf8 ## ##@* 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 ] { 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 { } ##