home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / EXPLODE.ZIP / TEAPOT.POV < prev   
Encoding:
Text File  |  1997-03-10  |  2.2 KB  |  65 lines

  1. // OBJECT EXPLODER: EXPLODING TEAPOT ANIMATION
  2. // *******************************************
  3. // This animation shows a teapot exploding on a wooden table.
  4.  
  5. // CAMERA AND LIGHTS
  6.    camera {location <5, 5, -15> look_at <0, 1, 0> angle 35}
  7.    light_source {<5, 5, -20> rgb <1, 1, 1>}
  8.    light_source {<-5, 20, 5> rgb <1, 1, 1>}
  9.  
  10. // SCENE DEFINITIONS
  11.    #declare TeaPot = union {
  12.       sphere {<0, 1, 0>, 1 scale <1.2, 1, 1.2>}
  13.       sphere {<0, 0, 0>, 1 scale <.7, .2, .7> translate <0, .2, 0>}
  14.       sphere {<0, 0, 0>, 1 scale <.8, .2, .8> translate <0, 1.8, 0>}
  15.       sphere {<0, 2.1, 0>, .15}
  16.       torus {.4, .1 rotate x * 90 translate <1.3, 1, 0>}
  17.       cone {<-.8, .8, 0>, .3, <-1.8, 1.5, 0>, .1 open}
  18.       pigment {rgb <.4, .8, 1>}
  19.       finish {phong .4 phong_size 7}}
  20.  
  21. // WOODEN TABLE
  22.    disc {<0, 0, 0>, y, 6
  23.       pigment {onion pigment_map {
  24.          [.3 wood color_map {[0 rgb <.8, .6, .4>] [1 rgb <.6, .4, .2>]}
  25.             warp {turbulence .3 octaves 3 lambda 3}
  26.             scale .2 rotate <0, 30, 0> translate x * 10
  27.             scale 1 / 6]
  28.          [1 rgb 0]}
  29.          scale 6}
  30.       finish {phong .3 phong_size 10 reflection .2 ambient .6 diffuse .4}}
  31.  
  32. // SHAKE TEAPOT FOR FIRST PART OF ANIMATION
  33.    #switch (clock)
  34.       #range (0, .5)
  35.          #declare MClock = pow (clock * 2, 2)
  36.          object {TeaPot translate vrotate (x * MClock * .2, y * 360 * MClock * 20)}
  37.          #break
  38.  
  39. // EXPLOSION PARAMETERS
  40.    #else
  41.       #declare explode_clock = (clock - .5) * 7
  42.       #declare explode_object = TeaPot
  43.       #declare object_corner1 = <-1.9, 0, -1.2>
  44.       #declare object_corner2 = <1.8, 2.3, 1.2>
  45.       #declare object_hollow = true
  46.       #declare particle_res = <5, 3, 3>
  47.       #declare exp_location = <0, -2, 0>
  48.       #declare exp_strength = 4
  49.       #declare exp_gravity = 10
  50.       #declare exp_spin = .5
  51.       #declare exp_seed = 87632
  52.       #declare ground_plane = true
  53.       #declare ground_reflection = .6
  54.       #declare max_bounces = 1
  55.       #declare exp_turb = 1
  56.       #declare scale_turb = 1
  57.       #declare rotate_turb = 1
  58.       #declare vel_turb = .3
  59.       #declare dir_turb = .1
  60.       #declare spin_turb = .5
  61.  
  62. // CREATE EXPLODING TEAPOT
  63.       #include "Explode.inc"
  64.    #end
  65.