POV-Ray : Newsgroups : povray.advanced-users : Correct function/pigment syntax? Server Time
30 Dec 2024 12:45:26 EST (-0500)
  Correct function/pigment syntax? (Message 1 to 4 of 4)  
From: Mike Horvath
Subject: Correct function/pigment syntax?
Date: 13 May 2021 18:19:05
Message: <609da5d9@news.povray.org>
I am trying to combine pigments and functions in different ways. Here is 
an example:


#declare pigment_1 = pigment
{
	slope {+y}
	color_map
	{
		[0 rgb 0]
		[1 rgb 1]
	}
}
#declare function_1 = function {pigment {pigment_1}}
#declare pigment_2 = pigment {function {function_1(x,y,z)}


But I am getting a parse error on pigment_2. What is the correct syntax 
to get this example to work?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Correct function/pigment syntax?
Date: 13 May 2021 18:31:04
Message: <609da8a8$1@news.povray.org>
See my post in p.t.s-f





On 5/13/2021 6:19 PM, Mike Horvath wrote:
> I am trying to combine pigments and functions in different ways. Here is 
> an example:
> 
> 
> #declare pigment_1 = pigment
> {
>      slope {+y}
>      color_map
>      {
>          [0 rgb 0]
>          [1 rgb 1]
>      }
> }
> #declare function_1 = function {pigment {pigment_1}}
> #declare pigment_2 = pigment {function {function_1(x,y,z)}
> 
> 
> But I am getting a parse error on pigment_2. What is the correct syntax 
> to get this example to work?
> 
> 
> Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Correct function/pigment syntax?
Date: 13 May 2021 19:10:00
Message: <web.609db1172fe55fc21f9dae3025979125@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> But I am getting a parse error on pigment_2. What is the correct syntax
> to get this example to work?

You don't have to use the x, y, z until you actually evaluate the function for
something.

So you should just be able to do:

#declare pigment_2 = pigment {function {function_1}}

Also, test_clu.pov ran for 6:45, and I halted it, as it was still parsing away
like mad.  You must have quite a system if you did it in 2:20.

Maybe just attach your completed render?


Post a reply to this message

From: Mike Horvath
Subject: Re: Correct function/pigment syntax?
Date: 13 May 2021 19:33:33
Message: <609db74d$1@news.povray.org>
On 5/13/2021 7:07 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
> 
>> But I am getting a parse error on pigment_2. What is the correct syntax
>> to get this example to work?
> 
> You don't have to use the x, y, z until you actually evaluate the function for
> something.
> 
> So you should just be able to do:
> 
> #declare pigment_2 = pigment {function {function_1}}
> 

I found what I was looking for here:

http://news.povray.org/povray.newusers/thread/%3C5473da29%40news.povray.org%3E/

But I cannot get it to produce anything other than rgb <0,0,0> in the 
render. See p.t.s-f.




> Also, test_clu.pov ran for 6:45, and I halted it, as it was still parsing away
> like mad.  You must have quite a system if you did it in 2:20.
> 
> Maybe just attach your completed render?
> 
> 
> 
> 

I got this all to work. Will update the other thread later.


Mike


Post a reply to this message

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