POV-Ray : Newsgroups : povray.advanced-users : "f_r" function help : Re: "f_r" function help Server Time
25 Apr 2024 08:12:21 EDT (-0400)
  Re: "f_r" function help  
From: Alain
Date: 9 Mar 2017 11:31:05
Message: <58c18349$1@news.povray.org>
Le 17-03-08 à 19:45, Mike Horvath a écrit :
> I want to use the "f_r" function to color a sphere from black (inner) to
> white (outer). However, there needs to be a hole in the center equal to
> 1/7 of the sphere's radius, and the gradient must start at this location
> instead of the sphere's exact center.
>
> Here is what I have:
>
> pigment
> {
>     function {f_r(x,y,z) * 6/7 + 1/7}
>     pigment_map
>     {
>         [0 color srgb 0]
>         [1 color srgb 1]
>     }
> }
>
> But the results are not correct.
>
> How do I accomplish this? Thanks!
>
>
> Mike

function {f_r(x,y,z)}
pigment_map{
  [1/7 rgbt 1] // optionnal
  [1/7 srgb 0]
  [1   srgb 1]
}

Fully transparent from the center up to 1/7 th of the radius.
Then, black at 1/7 th of the radius.
Finally, gradually fade to white.


Post a reply to this message

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