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

  1. #VRML V1.0 ascii
  2.  
  3. Separator {
  4.     # Options: ON OFF AUTO
  5.     renderCulling AUTO
  6.     
  7.     OUTPUT_TO Drive.wrl
  8.     
  9.     PerspectiveCamera {
  10.         position 0 2 10
  11.         focalDistance 5
  12.         heightAngle 45'deg
  13.     }
  14.  
  15.     DEF BackgroundColor Info {
  16.         string  ".1 .1 .6"
  17.     }
  18.     
  19.     DEF param PARAMETERS {
  20.         fields [ SFFloat streetWidth, SFFloat lightSpacing ]
  21.         streetWidth 20'ft
  22.         lightSpacing  150'ft
  23.     }
  24.     
  25.     Material {
  26.         diffuseColor =grayColor(.5)
  27.     }
  28.     
  29.     DEF road Wall {
  30.         fields [ SFLong placement, SFFloat width, MFFloat height, 
  31.         MFFloat elevation, MFVec2f data ] 
  32.         placement -1 # -1: Inside, 1: Outside 
  33.         width param:streetWidth
  34.         height [ 6'in ]
  35.         elevation [ -6'in ]
  36.         data []
  37.     }
  38.     
  39.     DEF loop LOOP {
  40.         fields [ SFLong start, SFLong end, SFLong step, SFLong position, SFFloat path ]
  41.         start 0
  42.         end 20
  43.         step 1
  44.         path 0
  45.         
  46.         APPEND road:data (path+param:streetWidth/2,-position*param:lightSpacing)
  47.  
  48.         Separator {
  49.             # Options: ON OFF AUTO
  50.             renderCulling AUTO
  51.                 
  52.             Transform {
  53.                 translation path-1-param:streetWidth/2 0 -position*param:lightSpacing
  54.             }
  55.                         
  56.             PARAMETERS {
  57.                 fields [SFVec3f centerLOD, SFFloat streetLightHeight, SFFloat streetLightArmLength ]
  58.                 centerLOD path-1-param:streetWidth/2 0 -position*param:lightSpacing
  59.                 streetLightHeight 20'ft
  60.                 streetLightArmLength 2'ft
  61.             
  62.                 INCLUDE StreetLight.vxr
  63.             }
  64.         }
  65.         
  66.         Separator {
  67.             # Options: ON OFF AUTO
  68.             renderCulling AUTO
  69.             
  70.             Transform {
  71.                 translation path+1+param:streetWidth/2 0 -position*param:lightSpacing
  72.                 rotation 0 1 0 pi()
  73.             }
  74.             
  75.             PARAMETERS {
  76.                 fields [SFVec3f centerLOD, SFFloat streetLightHeight, SFFloat streetLightArmLength ]
  77.                 centerLOD path+1+param:streetWidth/2 0 -position*param:lightSpacing
  78.                 streetLightHeight 20'ft
  79.                 streetLightArmLength 2'ft
  80.             
  81.                 INCLUDE StreetLight.vxr
  82.             }
  83.             
  84.             SET loop:path loop:path+(rand()-.5)*10
  85.         }
  86.     }
  87. }