|
|
"Chrisir" <nomail@nomail> wrote in message
news:web.43f63134b1f8d7edbd391bf80@news.povray.org...
>
>
> Hello!
>
> I have a spline with spheres on it and I want the spheres to smoothly
> change
> their color from sphere to sphere between two given colors (start and end
> color = start and end of the spline).
> I need only the color bit. I work with the 'clock'-Variable.
>
> Thanks!
>
> Chrisir
>
Hi Chrisir,
If you just want to change from one colour to another as the clock variable
changes from 0 to 1, then you can do:
camera {location <0,0,-4> look_at <0,0,0>}
light_source{<3,10,-10> rgb 1}
#include "colors.inc"
#declare myColour = Red*clock + Yellow*(1-clock);
sphere {0,1 pigment {color myColour}}
If you render the above with command line options of '+kfi0 +kff10' you
should see the color change.
Because the colors are just vectors you can take a proportion of one and a
proportion of the other and add them together.
For example when the clock is at 0.2 you get 20% Red and 80% Yellow.
Regards,
Chris B.
Post a reply to this message
|
|