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

  1. #VRML V1.0 ascii
  2.  
  3. Separator {
  4.     # Options: ON OFF AUTO
  5.     renderCulling AUTO
  6.     
  7.     OUTPUT_TO grid3D.wrl
  8.     
  9.     PerspectiveCamera {
  10.         position 25 25 25
  11.         orientation =PointAt(0,0,0)
  12.         focalDistance 20
  13.         heightAngle 45'deg
  14.     }
  15.     
  16.     DEF BackgroundColor Info {
  17.         string  ".1 .5 .7"
  18.     }
  19.  
  20.     Material {
  21.         diffuseColor =Color("white")
  22.     }
  23.     
  24.     DEF gridDataXZ Coordinate3 {
  25.         point [] # MFVec3f
  26.     }
  27.     
  28.     DEF gridXZ IndexedLineSet {
  29.         coordIndex [] # MFLong
  30.     }
  31.     
  32.     LOOP {
  33.         fields [ SFLong start, SFLong end, SFLong step, SFLong position ]
  34.         start 0
  35.         end 10+1
  36.         step 1   
  37.         
  38.         APPEND gridDataXZ:point (0,0,position)
  39.         APPEND gridDataXZ:point (10,0,position)
  40.         APPEND gridDataXZ:point (position,0,0)
  41.         APPEND gridDataXZ:point (position,0,10)
  42.  
  43.         APPEND gridXZ:coordIndex (position-start)*4
  44.         APPEND gridXZ:coordIndex (position-start)*4+1
  45.         APPEND gridXZ:coordIndex -1        
  46.         APPEND gridXZ:coordIndex (position-start)*4+2
  47.         APPEND gridXZ:coordIndex (position-start)*4+3
  48.         APPEND gridXZ:coordIndex -1        
  49.     }
  50.  
  51.     Material {
  52.         diffuseColor =Color("white")
  53.     }
  54.     
  55.     DEF gridDataXY Coordinate3 {
  56.         point [] # MFVec3f
  57.     }
  58.     
  59.     DEF gridXY IndexedLineSet {
  60.         coordIndex [] # MFLong
  61.     }
  62.     
  63.     LOOP {
  64.         fields [ SFLong start, SFLong end, SFLong step, SFLong position ]
  65.         start 0
  66.         end 10+1
  67.         step 1   
  68.         
  69.         APPEND gridDataXY:point (0,position,0)
  70.         APPEND gridDataXY:point (10,position,0)
  71.         APPEND gridDataXY:point (position,0,0)
  72.         APPEND gridDataXY:point (position,10,0)
  73.  
  74.         APPEND gridXY:coordIndex (position-start)*4
  75.         APPEND gridXY:coordIndex (position-start)*4+1
  76.         APPEND gridXY:coordIndex -1        
  77.         APPEND gridXY:coordIndex (position-start)*4+2
  78.         APPEND gridXY:coordIndex (position-start)*4+3
  79.         APPEND gridXY:coordIndex -1        
  80.     }
  81.  
  82.     Material {
  83.         diffuseColor =Color("white")
  84.     }
  85.     
  86.     DEF gridDataYZ Coordinate3 {
  87.         point [] # MFVec3f
  88.     }
  89.     
  90.     DEF gridYZ IndexedLineSet {
  91.         coordIndex [] # MFLong
  92.     }
  93.     
  94.     LOOP {
  95.         fields [ SFLong start, SFLong end, SFLong step, SFLong position ]
  96.         start 0
  97.         end 10+1
  98.         step 1   
  99.         
  100.         APPEND gridDataYZ:point (0,position,0)
  101.         APPEND gridDataYZ:point (0,position,10)
  102.         APPEND gridDataYZ:point (0,0,position)
  103.         APPEND gridDataYZ:point (0,10,position)
  104.  
  105.         APPEND gridYZ:coordIndex (position-start)*4
  106.         APPEND gridYZ:coordIndex (position-start)*4+1
  107.         APPEND gridYZ:coordIndex -1        
  108.         APPEND gridYZ:coordIndex (position-start)*4+2
  109.         APPEND gridYZ:coordIndex (position-start)*4+3
  110.         APPEND gridYZ:coordIndex -1        
  111.     }
  112. }