POV-Ray : Newsgroups : povray.advanced-users : "f_r" function help : Re: "f_r" function help Server Time
10 May 2024 09:50:33 EDT (-0400)
  Re: "f_r" function help  
From: Mike Horvath
Date: 10 Mar 2017 02:18:14
Message: <58c25336$1@news.povray.org>
On 3/9/2017 11:31 AM, Alain wrote:
> 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.


Thanks! That works.


Mike


Post a reply to this message

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