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

  1. include "../../colors.inc"
  2.  
  3. start_frame 0
  4. end_frame 80
  5.  
  6. define t0 0
  7. define t1 80
  8. define increment  (frame - t0) / (t1 - t0)
  9.  
  10. define Dim_Charcoal_Grey <0.184314, 0.309804, 0.309804>
  11. define Charcoal_Grey <0.28, 0.46, 0.46>
  12.  
  13. define bright_green texture { surface { color green ambient 1 diffuse 0 } }
  14. define clear texture { surface { ambient 0 diffuse 0 transmission white, 1, 1 }}
  15. define matte_charcoal
  16.    texture { matte { color Charcoal_Grey ambient 0.2 diffuse 0.8 } }
  17.  
  18. define pwidth  0.1
  19. define poffset (1.0 - increment) * (1 + pwidth)
  20. define phaser_fn1 noise(2*P, 1)
  21. define phaser_fn2 noise(2*(P+<0, 50, 100>), 1)
  22. define phaser_fn3 noise(2*(P+<50, -37, -17>), 1)
  23. define phaser_map1
  24.    texture_map([0, poffset-pwidth, shiny_red, shiny_red],
  25.            [poffset-pwidth, poffset, shiny_red, bright_green],
  26.            [poffset, 1, clear, clear])
  27. define phaser_map2
  28.    texture_map([0, poffset-pwidth, mirror, mirror],
  29.            [poffset-pwidth, poffset, mirror, bright_green],
  30.            [poffset, 1, clear, clear])
  31. define phaser_map3
  32.    texture_map([0, poffset-pwidth, matte_charcoal, matte_charcoal],
  33.            [poffset-pwidth, poffset, matte_charcoal, bright_green],
  34.            [poffset, 1, clear, clear])
  35.  
  36. // Define the color of the gun assembly
  37. define Body_Tex1 texture { indexed phaser_fn1, phaser_map1 }
  38. define Body_Tex2 texture { indexed phaser_fn2, phaser_map2 }
  39. define Gun_Texture texture { indexed phaser_fn3, phaser_map3 }
  40.  
  41. // A single UFO
  42. include "ufo1.inc"
  43.  
  44. // Define the location and orientation of the UFO
  45. // Only change x and z for now to get the locations
  46. define UFO_Location1 <0, 20, 0>
  47. define UFO_Orientation1 <30, 60, 0>
  48.  
  49. // Change the orientations of the barrels for the ufo.
  50. define Gun_Orientation1_1 <90, 80, 0>
  51. define Gun_Orientation1_2 <90, 80, 0>
  52.  
  53. // Now make a UFO with a gun assembly hanging off the top and bottom
  54. object {
  55.    UFO_Body
  56.    + Gun_Barrels { rotate Gun_Orientation1_1 translate Gun_Assembly_Location1 }
  57.    + Gun_Barrels { rotate Gun_Orientation1_2 translate Gun_Assembly_Location2 }
  58.    rotate <-30, 0, 0>
  59.    }
  60.  
  61. // Put in some ground for reference
  62. // object { disc <0, -30, 0>, <0, 1, 0>, 500 Ground_Texture }
  63.  
  64. viewpoint {
  65.    from  <0, 20, -150.0>
  66.    at <0, 0, 0>
  67.    up <0, 1, 0>
  68.    angle 40
  69.    resolution 160, 120
  70.    aspect 4/3
  71.    }
  72.  
  73. light 0.8*white, < 100, 200, -100>
  74. background black
  75.