POV-Ray : Newsgroups : povray.general : radial colour gradient : Re: radial colour gradient Server Time
31 Jul 2024 18:23:32 EDT (-0400)
  Re: radial colour gradient  
From: Alain
Date: 18 Oct 2006 20:30:29
Message: <4536c725$1@news.povray.org>
Dav_shef nous apporta ses lumieres en ce 18/10/2006 05:20:
> Hi All,

> I am trying to get a sphere with a radial colour gradient.
> For example, a red sphere that gradually becomes white in its center.
> Is there a way to do that ?

> Cheers

> Dav


You can use the spherical pattern. It goes from a value of 1 at the origin and 
drop to zero at a radius of 1 then stay there.
Use it with  color_map{[0 Red][1 White]} and scale that to your spgere radius.
The onion proposed by Chris B is similar but repeats itself each unit radius.
If your sphere is transparent, you can use the same pattern, but use it to 
madulate the density of a media filling the sphere. Don't forget to add hollow 
to your sphere so that it can actualy contain the media.

-- 
Alain
-------------------------------------------------

Did you know that Al Capone's business card said he was a used furniture dealer.


Post a reply to this message

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