POV-Ray : Newsgroups : povray.advanced-users : Functions + variables Server Time
24 Nov 2024 14:28:44 EST (-0500)
  Functions + variables (Message 1 to 5 of 5)  
From: Orchid XP v2
Subject: Functions + variables
Date: 14 Apr 2006 16:04:11
Message: <4440003b$1@news.povray.org>
I tried to do this:

pigment {function {f_bozo(x, y + frame_number, z)}}

...and got an error message. Seems POV-Ray doesn't think "frame_number" 
is a valid token. (Was expecting ",".)

Anybody wanna take a guess why this is happening? I just want the 
function to change slightly each frame...


Post a reply to this message

From: Mike Williams
Subject: Re: Functions + variables
Date: 14 Apr 2006 16:16:50
Message: <IX2R6UAlMAQEFwrx@econym.demon.co.uk>
Wasn't it Orchid XP v2 who wrote:
>I tried to do this:
>
>pigment {function {f_bozo(x, y + frame_number, z)}}
>
>...and got an error message. Seems POV-Ray doesn't think "frame_number" 
>is a valid token. (Was expecting ",".)
>
>Anybody wanna take a guess why this is happening? I just want the 
>function to change slightly each frame...

This works:

#declare F = frame_number;
...
pigment {function {f_bozo(x, y + F, z)}}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Orchid XP v2
Subject: Re: Functions + variables
Date: 14 Apr 2006 16:39:12
Message: <44400870$1@news.povray.org>
>>Anybody wanna take a guess why this is happening? I just want the 
>>function to change slightly each frame...
> 
> 
> This works:
> 
> #declare F = frame_number;
> ...
> pigment {function {f_bozo(x, y + F, z)}}

Interesting...

Oh well, thanks for that!

(I imagine if you dig through the innards of the parser there's probably 
a perfectly good reason why it does this. LOL!)


Post a reply to this message

From: Warp
Subject: Re: Functions + variables
Date: 14 Apr 2006 16:56:31
Message: <44400c7f@news.povray.org>
Orchid XP v2 <voi### [at] devnull> wrote:
> (I imagine if you dig through the innards of the parser there's probably 
> a perfectly good reason why it does this. LOL!)

  I suppose that the reason is simply that the keyword in question
has not been added to the user-defined-function universe, so when
the user-defined-function parser sees it, it thinks "oh, an unknown
name, let's see if there's an identifier of that name in in the SDL
universe -> no -> error".

  The SDL namespace and the user-defined-function namespace being two
completely different and separate universes causes indeed lots of
confusion. I have actually thought about writing a short article
about that at the povQ&T page.

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v2
Subject: Re: Functions + variables
Date: 14 Apr 2006 17:08:10
Message: <44400f3a$1@news.povray.org>
>>(I imagine if you dig through the innards of the parser there's probably 
>>a perfectly good reason why it does this. LOL!)
> 
> 
>   I suppose that the reason is simply that the keyword in question
> has not been added to the user-defined-function universe,
> 
>   The SDL namespace and the user-defined-function namespace being two
> completely different and separate universes

Yeah, I had thought it would be something like that...

> causes indeed lots of
> confusion. I have actually thought about writing a short article
> about that at the povQ&T page.

Possibly... It makes sense when you know how it works.


Post a reply to this message

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