POV-Ray : Newsgroups : povray.advanced-users : "f_r" function help Server Time: 18 Jun 2019 17:06:35 GMT
  "f_r" function help (Message 1 to 3 of 3)  
From: Mike Horvath
Subject: "f_r" function help
Date: 9 Mar 2017 00:44:56
Message: <58c0a588$1@news.povray.org>
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


Post a reply to this message

From: Alain
Subject: Re: "f_r" function help
Date: 9 Mar 2017 16: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

From: Mike Horvath
Subject: Re: "f_r" function help
Date: 10 Mar 2017 07: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-2008 Persistence of Vision Raytracer Pty. Ltd.