POV-Ray : Newsgroups : povray.general : Change Color of spheres on a spline while flight Server Time
1 Aug 2024 08:14:40 EDT (-0400)
  Change Color of spheres on a spline while flight (Message 1 to 2 of 2)  
From: Chrisir
Subject: Change Color of spheres on a spline while flight
Date: 17 Feb 2006 15:30:00
Message: <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


Post a reply to this message

From: Chris B
Subject: Re: Change Color of spheres on a spline while flight
Date: 17 Feb 2006 16:33:02
Message: <43f6410e$1@news.povray.org>
"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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.