home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1995 January / pcw-0195.iso / polyray / dat / animate / ufo / ground.inc < prev    next >
Encoding:
Text File  |  1994-12-31  |  1.4 KB  |  44 lines

  1. //
  2. // Cratered landscape.
  3. //
  4. // A bump function was added to the texture to add to the apparent level of
  5. // detail.  One way to reduce antialiasing in the render of this object is 
  6. // to remove the bump.  This will give a flat shaded surface at distance.
  7. //
  8. // This object is composed of two objects: a flat plane (made from a disc)
  9. // and a height field.  The plane is clipped by a box so that the height
  10. // field can be placed into the middle.  The height field is clipped by
  11. // a cylinder in the center so that the UFO launch pad can be inserted with
  12. // out odd pieces of the hf showing up.
  13. //
  14. // The height field was generated using a paint program to make circles
  15. // and lines.  An image processing program was then used to "blur" the
  16. // starting image.  This gave smoother edges to the crater and rift edges.
  17. //
  18. static define craters
  19. object {
  20.   object {
  21.     object { disc <0, 0, 0>, <0, 1, 0>, 1.5, 500 }
  22.       & ~object { box <-128, -100, -128>, <128, 100, 128> }
  23.       } +
  24.    object {
  25.       object {
  26.      smooth_height_field "crater2.jpg"
  27.      translate <-0.5, -48, -0.5>
  28.      rotate <0, 180, 0>
  29.      scale <256, 0.04, 256>
  30.      }
  31.       & ~object { cylinder <0, -100, 0>, <0, 100, 0>, 1.5 }
  32.       }
  33.    /*
  34.    texture {
  35.       special matte {
  36.      color white
  37.      normal N + (dnoise(P, 3) - white/2)
  38.      }
  39.       }
  40.    */
  41.    matte_white
  42.    translate <0, -1, 0>
  43.    }
  44.