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

  1. // Simple particle system
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. frame_time 0.1
  5. start_frame 0
  6. end_frame 92
  7. total_frames 93
  8.  
  9. // Set up the camera
  10. viewpoint {
  11.    from <0,8,-10>
  12.    at <0,2,0>
  13.    up <0,1,0>
  14.    angle 55
  15.    resolution 320, 160
  16.    aspect 2
  17.    }
  18.  
  19. background <0, 0, 0>
  20. light <-10, 30, -20>
  21.  
  22. include "../../colors.inc"
  23.  
  24. define asphere object { sphere <0, 0, 0>, 0.2 shiny_red }
  25. define bsphere object { sphere <0, 0, 0>, 0.2 shiny_blue }
  26.  
  27. // The force of gravity
  28. define gravity <0, -1, 0>
  29.  
  30. // Secondary burst on the ground
  31. if (frame == start_frame)
  32. static define part2
  33. particle {
  34.    death ((I[1] < 0 && y < 0.1) ? 1 : 0)
  35.    position P
  36.    velocity <0, 1.5, 0> + brownian(<0, 0, 0>, <1, 0.5, 1>)
  37.    acceleration gravity
  38.    object "asphere"
  39.    count 20
  40.    }
  41.  
  42. // Star burst
  43. if (frame == start_frame)
  44. particle {
  45.    death (y < 0.2 ? "part2" : 0)
  46.    position <0, 5, 0>
  47.    velocity 2*brownian(<0, 0, 0>, <1, 1, 1>)
  48.    acceleration gravity
  49.    object "bsphere"
  50.    count 50
  51.    }
  52.  
  53. object {
  54.    box <-10, -0.1, -10>, <10, 0, 10>
  55.    matte_yellow
  56.    }
  57.