|
|
"Alex" <ale### [at] hotmailcom> wrote in message
news:web.4a82745d1c23c4f8db8ca50@news.povray.org...
> Hi,
>
> How can I add 'true-indexed' RGB color to each point along a
> "sphere_sweep"
> object? In other words, if this "sphere_sweep" object is defined by N
> points, I
> would like to be able to specify N RGB colors.
>
> Many thanks in advance for helping me out!
>
> Cheers,
> Alex
>
I don't think there's an easy way of doing exactly that. OTOH you can do
something equivalent using splines and a #while loop quite easily. The
spline example below is taken straight from the spline section in the help
and illustrates using different colors along the length of an object created
using lots of spheres (in this case about 100). It shouldn't be too
difficult to adapt that to do something equivalent to what you ask.
camera {location <-1, 1,-1> look_at <0,0,0>}
light_source {<1,10,-1> color rgb 1}
#declare MySpline = spline {
cubic_spline
-.25, <0,0,-1>
0.00, <1,0,0>
0.25, <0,0,1>
0.50, <-1,0,0>
0.75, <0,0,-1>
1.00, <1,0,0>
1.25, <0,0,1>
}
#declare ctr = 0;
#while (ctr < 1)
sphere {
MySpline(ctr),.25
pigment { rgb <1-ctr,ctr,0> }
}
#declare ctr = ctr + 0.01;
#end
Regards,
Chris B.
Post a reply to this message
|
|