prev index next 
Animation 
 POV-Ray Tips, 
 Tricks, and Techniques
Change Object Color During Animation? 
 
Pal K. Tonder has a specific task: During a Pov-Ray animation I want an object to gradually change color. The new color should start from a given point on the object surface and gradially spread out until it fills the object.

Does anybody know how to do this ?
 

Chris Colefax has no problem with this:
Here is a simple scene that illustrates how you can use the onion pigment to do what you want:

   box {-1, 1
      pigment {onion color_map {
         [clock * .9 rgb <1, 0, 0>]
         [(clock * .9) + .1 rgb <1, 1, 0>]}
         turbulence .2 octaves 2
         scale 3 translate <-.7, .7, .7>}
      finish {phong .2 phong_size 15}}

   camera {location <2, 4, -5> look_at <0,0,0> angle 40}
   light_source {<10, 10, -20> rgb 1}
   light_source {<-20, 20, 10> rgb 1}

Render this into an animation and you will see how the object gradually turns from yellow to red, with the colour seeping across the object from a particular point.  You could also use a texture_map to blend between whole textures rather than just colours.
 

  1