POV-Ray : Newsgroups : povray.advanced-users : Finer points of function syntax : Re: Finer points of function syntax Server Time
19 Apr 2024 03:44:07 EDT (-0400)
  Re: Finer points of function syntax  
From: Bald Eagle
Date: 24 Jul 2019 14:35:01
Message: <web.5d38a4b14d13b5404eec112d0@news.povray.org>
Also wondering if there's a way to employ vector component dot notation keywords
in an array, or otherwise/workaround.

Such as:

#declare VecC = array [5] {red, green, blue, filter, transmit];

Thus allowing things like

function { Something (x, y, z).Vec[N] }

Maybe there's a way to "wrap" such things in a directive like keyword (red) or
include (red) so that the parser "reads through" the directive and treats the
internal part as though it were #include-d, and array [1] {include(red)} would
be a valid statement.
I'm only suggesting it because I know clipka relishes the idea of rewriting the
parser.  :D



And, just because this never occurred to me the last time we delved into vector
component names:

Perhaps it would help keep things straight for new users, and help avoid
confusion when debugging if there were a numeric designation for vector
components 1-5.

To my knowledge, we don't use @ as a reserved symbol, so maybe
Vector.@1, Vector.@2, Vector.@3, Vector.@4, Vector.@5 could be something to
consider as an addition to the language somewhere down the line.


Post a reply to this message

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