home *** CD-ROM | disk | FTP | other *** search
- // Simple particle system
- // Polyray input file: Alexander Enzmann
-
- frame_time 0.1
- start_frame 0
- end_frame 60
- total_frames 61
-
- // The variable t must be declared "noeval" in order to use it in
- // expressions that are within a particle generator. If we didn't use
- // noeval, all the particles would end up being emitted from the exact
- // same location.
- define noeval t frame / total_frames
-
- // Set up the camera
- viewpoint {
- from <0,8,-10>
- at <0,2,0>
- up <0,1,0>
- angle 55
- resolution 320, 160
- aspect 2
- }
-
- background <0, 0, 0>
- light <-10, 30, -20>
-
- include "../../colors.inc"
-
- define tex1 texture { special shiny { color <0, 0, 1> } }
- define tex2 texture { special shiny { color <0.25, 0, 0.75> } }
- define tex3 texture { special shiny { color <0.5, 0, 0.5> } }
- define tex4 texture { special shiny { color <0.75, 0, 0.25> } }
- define tex5 texture { special shiny { color <1, 0, 0> } }
-
- define bsphere1 object { sphere <0, 0, 0>, 0.2 tex1 uv_steps 6, 3 }
- define bsphere2 object { sphere <0, 0, 0>, 0.3 tex2 uv_steps 6, 3 }
- define bsphere3 object { sphere <0, 0, 0>, 0.4 tex3 uv_steps 6, 3 }
- define bsphere4 object { sphere <0, 0, 0>, 0.5 tex4 uv_steps 6, 3 }
- define bsphere5 object { sphere <0, 0, 0>, 0.6 tex5 uv_steps 6, 3 }
-
- // emission_position and emission_magnitude are used within a particle
- // generator, so they are noeval. Note that since "t" is used within
- // these expressions, it must also be declared noeval.
- define noeval emission_position <8 * sin(radians(720 * t)), 0, 0>
- define noeval emission_magnitude 1.5 + 0.5 * cos(radians(4*360 * t))
-
- // define chimny
- object {
- object { cone <0, 0, 0>, 1, <0, 1, 0>, 0.5 }
- + object { disc <0, 1, 0>, <0, 1, 0>, 0.3, 0.5 }
- translate emission_position
- }
-
- // The force of gravity
- define gravity <0, -1, 0>
-
- // Define the emmisions from the chimny
- if (frame == start_frame) {
- static define part5
- particle {
- death (u > 0.3 ? 1 : 0)
- position P
- velocity I
- object "bsphere5"
- count 1
- }
-
- static define part4
- particle {
- death (u > 0.3 ? "part5" : 0)
- position P
- velocity I
- object "bsphere4"
- count 1
- }
-
- static define part3
- particle {
- death (u > 0.3 ? "part4" : 0)
- position P
- velocity I
- object "bsphere3"
- count 1
- }
-
- static define part2
- particle {
- death (u > 0.3 ? "part3" : 0)
- position P
- velocity I
- object "bsphere2"
- count 1
- }
-
- // define starting particle system for spewing smoke
- particle {
- birth 1 // Particles are created every frame
- death (u > 0.3 ? "part2" : 0) // They change form after 3 frames
- position emission_position + <0, 1, 0>
- velocity emission_magnitude * brownian(<0, 0, 0>, <1, 1, 1>)
- object "bsphere1"
- count 10
- }
- }
-
- /*
- object {
- polygon 4, <-10, 0,-10>, <-10, 0, 10>, < 10, 0, 10>, < 10, 0,-10>
- matte_yellow
- }
- */
-