POV-Ray : Newsgroups : povray.general : radial colour gradient : Re: radial colour gradient Server Time
31 Jul 2024 18:19:49 EDT (-0400)
  Re: radial colour gradient  
From: Chris B
Date: 18 Oct 2006 17:53:34
Message: <4536a25e$1@news.povray.org>
"Dav_shef" <nomail@nomail> wrote in message 
news:web.4535f1f1ae8bc416699678ae0@news.povray.org...
> 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
>

Hi Dav,

Here's something that does what I think may be what you're asking for:
I've done a difference so you can see the white center.

light_source { <10, 20,-30> color rgb<1, 1, 1>}
camera {location <1, 1, -3> look_at <0,0, 0>}

difference {
  sphere {0,1}
  box {0,<1,1,-1>}
  pigment {onion
    color_map {
      [0 color rgb <1,1,1>]
      [1 color rgb <1,0,0>]
    }
  scale 1.001}
}

Regards,
Chris B.


Post a reply to this message

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