home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / vrml / MWE105.ZIP / EExamples / StreetLight.vxr < prev    next >
Text File  |  1996-01-23  |  2KB  |  92 lines

  1. #VRML V1.0 ascii
  2.  
  3. # This file defines a simple street light
  4.  
  5. #PARAMETERS {
  6.     #    fields [SFVec3f centerLOD, SFFloat streetLightHeight, SFFloat streetLightArmLength ]
  7.     #    centerLOD 0 0 0
  8.     #    streetLightHeight 20'ft
  9.     #    streetLightArmLength 2'ft
  10.     #
  11.     #    INCLUDE StreetLight.vxr
  12. #}
  13.  
  14. DEF streetLight LOD {
  15.     range [ 200'ft, 600'ft ] # MFFloat
  16.     center =centerLOD 
  17.     
  18.     DEF highDetail Separator {
  19.         Separator {
  20.             Translation {
  21.                 translation 0 (base:height)/2 0
  22.             }
  23.             
  24.             DEF base Cylinder {
  25.                 parts ALL
  26.                 radius 10'in
  27.                 height 10'in
  28.             }
  29.         }
  30.     
  31.         Separator {
  32.             Translation {
  33.                 translation 0 base:height+(pole:height/2) 0
  34.             }
  35.         
  36.             DEF pole Cylinder {
  37.                 parts ALL
  38.                 radius 3'in
  39.                 height streetLightHeight-base:height 
  40.             }
  41.         }
  42.             
  43.         Separator     {    
  44.             
  45.             Transform     {
  46.                 # Put the arm just below the top of the pole
  47.                 translation arm:height/2 base:height+pole:height-arm:radius 0
  48.                     
  49.                 # rotate the cylinder from it's vertial position to a horzonial position on the x-axis
  50.                 rotation =rotate(0,1,0,1,0,0)
  51.             }
  52.                                 
  53.             DEF arm Cylinder {
  54.                 parts ALL
  55.                 radius 3'in
  56.                 height streetLightArmLength 
  57.             }
  58.         }
  59.                 
  60.         Separator {    
  61.             DEF lightLocation Translation {
  62.                 translation streetLightArmLength streetLightHeight-light:radius 0
  63.             }
  64.                     
  65.             Material {
  66.                 emissiveColor .9 .9 .9    
  67.             }
  68.                         
  69.             DEF light Sphere {
  70.                 radius 9'in
  71.             }
  72.                     
  73.         }
  74.     }
  75.         
  76.     DEF medDetail Separator {
  77.         Separator {                        
  78.             Translation {
  79.                 translation streetLightArmLength streetLightHeight-light:radius 0
  80.             }
  81.  
  82.             Material {
  83.                 emissiveColor .9 .9 .9    
  84.             }
  85.                         
  86.             DEF light Sphere {
  87.                 radius 9'in
  88.             }
  89.         }
  90.     }
  91. }
  92.