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

  1. #VRML V1.0 ascii
  2.  
  3. Separator {
  4.     
  5.     OUTPUT_TO Fractal.wrl
  6.  
  7.     DEF BackgroundColor Info {
  8.         string  ".8 .1 .1"
  9.     }
  10.     
  11.     Material {
  12.         diffuseColor .8 .8 .8
  13.     }
  14.     
  15.     DEF local PARAMETERS {
  16.         fields [SFFloat size, SFFloat ruggedness, MFFloat initialData]
  17.         size 24
  18.         ruggedness 1.5
  19.         initialData 8
  20.     }
  21.     
  22.     PerspectiveCamera {
  23.         position 0 2 local:size*9
  24.         orientation =PointAt(0,0,0)
  25.         focalDistance 5
  26.         heightAngle 45'deg
  27.     }
  28.     
  29.     Coordinate3 {
  30.         point =FractalSurfaceData(local:size,local:size,local:ruggedness,local:initialData)
  31.     }
  32.     
  33.     DEF mountain IndexedFaceSet {
  34.         coordIndex =FractalSurfaceIndex(local:size,local:size)
  35.     }
  36.     
  37.     Separator {
  38.         # Options: ON OFF AUTO
  39.         renderCulling AUTO
  40.         Translation {
  41.             translation 0 -world:height/2 0
  42.         }
  43.         
  44.         Material {
  45.             ambientColor 0.4 0.4 0.4
  46.         }
  47.         
  48.         DEF world Cylinder {
  49.             parts ALL
  50.             radius local:size*10 
  51.             height local:size
  52.         }
  53.     }
  54.     
  55.     LOOP {
  56.         fields [ SFFloat start, SFFloat end, SFFloat step, SFFloat position ]
  57.         start 0
  58.         end 10
  59.         step 1
  60.         
  61.         Separator {
  62.             # Options: ON OFF AUTO
  63.             renderCulling AUTO
  64.             
  65.             Transform {
  66.                 translation local:size*10*(rand()-.5) -.2 local:size*10*(rand()-.5)
  67.                 rotation 0 1 0 (rand()-.5)*pi()
  68.                 scaleFactor (rand()+.6) (rand()+.6) (rand()+.6)
  69.             }            
  70.             USE mountain         
  71.         }
  72.     }
  73. }