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

  1. // Simple particle system
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. frame_time 0.1
  5. start_frame 0
  6. end_frame 250
  7. total_frames 250
  8.  
  9. // Set up the camera
  10. viewpoint {
  11.    from <0,20,-15>
  12.    at <0,2,0>
  13.    up <0,1,0>
  14.    angle 60
  15.    resolution 200, 200
  16.    }
  17.  
  18. background <0, 0, 0>
  19. light <-10, 30, -20>
  20.  
  21. include "../../colors.inc"
  22.  
  23. define asphere object { sphere <0, 0, 0>, 0.3 shiny_red uv_steps 8, 4 }
  24. define bsphere object { sphere <0, 0, 0>, 0.3 shiny_blue uv_steps 8, 4 }
  25.  
  26. define gravity <0, -1, 0>
  27.  
  28. // Secondary burst in the air
  29. if (frame == start_frame)
  30. static define part2
  31. particle {
  32.    death ((I[1] < 0 && y < 0.1) ? 1 : 0)
  33.    position P
  34.    velocity <0, 1.5, 0> + brownian(<0, 0, 0>, <1, 0.5, 1>)
  35.    acceleration gravity
  36.    object "asphere"
  37.    count 20
  38.    }
  39.  
  40. // Central burst of spheres - these spheres bounce
  41. if (frame == start_frame)
  42. particle {
  43.    avoid 1
  44.    death (|x| > 10 || |z| > 10 ? 1 : (|y| > 3 ? "part2" : 0))
  45.    position <0, 1, 0>
  46.    velocity 5*brownian(<0, 0, 0>, <1, 0, 1>)
  47.    object "bsphere"
  48.    count 20
  49.    }
  50.  
  51. // Floor
  52. object { box <-10, -0.1, -10>, <10, 0, 10> matte_yellow }
  53.  
  54. // Walls
  55. object {
  56.    object { box <-10, -0.1, -10>, <-9, 3, 10> } +
  57.    object { box <  9, -0.1, -10>, <10, 3, 10> } +
  58.    object { box <-10, -0.1, -10>, <10, 3, -9> } +
  59.    object { box <-10, -0.1,   9>, <10, 3, 10> }
  60.    }
  61.  
  62. // Obstacles
  63. define can
  64. object { 
  65.    object { cylinder <0, 0, 0>, <0, 2, 0>, 1 } +
  66.    object { disc <0, 0, 0>, <0,-1, 0>, 1 } +
  67.    object { disc <0, 2, 0>, <0, 1, 0>, 1 }
  68.    shiny_green
  69.    }
  70.  
  71. can { translate <-5, 0, -5> }
  72. can { translate <-5, 0,  5> }
  73. can { translate < 5, 0, -5> }
  74. can { translate < 4, 0,  5> }
  75.  
  76. object { sphere <-6, 0, 0>, 1 shiny_green scale <1, 2, 1> }
  77. object { sphere < 6, 0, 0>, 1 shiny_green scale <1, 2, 1> }
  78. object { sphere < 0, 0,-6>, 1 shiny_green scale <1, 2, 1> }
  79. object { sphere < 0, 0, 6>, 1 shiny_green scale <1, 2, 1> }
  80.