POV-Ray : Newsgroups : povray.documentation.inbuilt : Mysterious function argument : Re: Mysterious function argument Server Time
25 Apr 2024 13:22:50 EDT (-0400)
  Re: Mysterious function argument  
From: Bald Eagle
Date: 30 Sep 2021 13:30:00
Message: <web.6155f3783ec630371f9dae3025979125@news.povray.org>
"B. Gimeno" <nomail@nomail> wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>
> > This suggests that POV-Ray pre-assigned 0 to x.  That this construction
> > is given as an example suggests that this is a significant feature
> > (however inadvisable to use), and not just a parser glitch.  Shouldn't
> > there be some explanation of this feature?
>
> https://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_1_6_6
>
> "All built-in vector identifiers never change value. They are defined as though
> the following lines were at the start of every scene.
>
> #declare x = <1, 0, 0>;
> #declare y = <0, 1, 0>;
> #declare z = <0, 0, 1>;
> #declare t = <0, 0, 0, 1>;
> #declare u = <1, 0>;
> #declare v = <0, 1>;
>
>
> It shouldn't be like you say. But by the trunk of the fifth elephant that it is.
>
> B. Gimeno

Right, but those are if you're accessing those values from the regular parser.
When you access them from the _function parser / VM_, you get a different set of
values.  I made a post about this once - and of course I can't find it ATM.

AFAIK, if you use all of those identifiers in a function, they will all return
zero until you assign them a value by passing a value into the function call
using that variable name.

As Ricky says, it's certainly a useful "feature", but could probably use a good
post, some example code, or at some point, a more detailed explanation in the
documentation.


Post a reply to this message

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