home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / vr386 / octball.plg < prev    next >
Text File  |  1996-03-19  |  2KB  |  89 lines

  1. # an octagonal ball visible from the outside, 1000x1000
  2. octball 32 26
  3.  
  4. # vertices:
  5. # X    Y    Z
  6.         # front middle ring
  7. -190 -460 -190  # vertex 0
  8.  190 -460 -190  # vertex 1
  9.  460 -190 -190  # vertex 2
  10.  460  190 -190  # vertex 3
  11.  190  460 -190  # vertex 4
  12. -190  460 -190  # vertex 5
  13. -460  190 -190  # vertex 6
  14. -460 -190 -190  # vertex 7
  15.  
  16.         # rear middle ring
  17. -190 -460  190  # vertex 8
  18.  190 -460  190  # vertex 9
  19.  460 -190  190  # vertex 10
  20.  460  190  190  # vertex 11
  21.  190  460  190  # vertex 12
  22. -190  460  190  # vertex 13
  23. -460  190  190  # vertex 14
  24. -460 -190  190  # vertex 15
  25.  
  26.         # front face
  27. -85  -192 -460  # vertex 16
  28.  85  -192 -460  # vertex 17
  29.  192  -85 -460  # vertex 18
  30.  192   85 -460  # vertex 19
  31.  85   192 -460  # vertex 20
  32. -85   192 -460  # vertex 21
  33. -192   85 -460  # vertex 22
  34. -192  -85 -460  # vertex 23
  35.  
  36.         # back face
  37. -85  -192  460  # vertex 24
  38.  85  -192  460  # vertex 25
  39.  192  -85  460  # vertex 26
  40.  192   85  460  # vertex 27
  41.  85   192  460  # vertex 28
  42. -85   192  460  # vertex 29
  43. -192   85  460  # vertex 30
  44. -192  -85  460  # vertex 31
  45.  
  46. # polygons: all cosine-lit, assorted colors
  47. # color #verts vert1 vert2 ...
  48.  
  49. 0x11ff 8 16 17 18 19 20 21 22 23  # front face: counterclockwise
  50. 0x12ff 8 31 30 29 28 27 26 25 24  # back face:  clockwise
  51.  
  52. # middle ring of polys: same as the octagonal cylinder
  53. # these faces are facing us in the sketch, thus are CCW
  54. 0x13ff 4 5 4 12 13  # top
  55. 0x14ff 4 4 3 11 12
  56. 0x15ff 4 3 2 10 11  # right side
  57. 0x16ff 4 2 1 9 10
  58.  
  59. # these faces are away from us in the sketch, and thus CW
  60. 0x17ff 4 8 9 1 0   # bottom
  61. 0x18ff 4 15 8 0 7
  62. 0x19ff 4 14 15 7 6 # left side
  63. 0x1aff 4 13 14 6 5
  64.  
  65. # Now we need to create the end poly rings. We can simply use
  66. # the polys above, changing the vertex numbers because we kept
  67. # the rings of vertexes together
  68.  
  69. # frontmost ring: vertices 0..7 -> 16..23,  8..15 -> 0..7
  70. 0x13ff 4  21 20 4 5   # top
  71. 0x14ff 4  20 19 3 4
  72. 0x15ff 4  19 18 2 3   # right side
  73. 0x16ff 4  18 17 1 2
  74. 0x17ff 4  0 1 17 16   # bottom
  75. 0x18ff 4  7 0 16 23
  76. 0x19ff 4  6 7 23 22   # left side
  77. 0x1aff 4  5 6 22 21
  78.  
  79. # rearmost ring:  vertices 8..15 -> 24..31, 0..7 -> 8..15
  80. 0x13ff 4 13 12 28 29   # top
  81. 0x14ff 4 12 11 27 28
  82. 0x15ff 4 11 10 26 27   # right side
  83. 0x16ff 4 10 9  25 26
  84. 0x17ff 4 24 25 9  8    # bottom
  85. 0x18ff 4 31 24 8  15
  86. 0x19ff 4 30 31 15 14   # left side
  87. 0x1aff 4 29 30 14 13
  88.  
  89.