|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Let's suppose I have:
#version 3.7;
global_settings {assumed_gamma 1.0}
#declare Scalar = array [5] {0, 1, 2, 3, 4}
#declare Vector = array [5] {<0, 0, 0>, <1, 1, 1>, <2, 2, 2>, <3, 3, 3>, <4, 4,
4>}
#declare String = array [5] {"A", "B", "C", "D", "E"}
#declare BigArray = array [3] {Scalar, Vector, String}
How do I access one of the values in the sub-arrays through BigArray / in a
single step ?
It doesn't appear that there's a sensible syntax for that.
#declare Var1 = BigArray[0];
would only make Var1 the whole scalar array, and it's only a 1-dimensional array
of 3 other arrays, so I can't use two bracketed values...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Let's suppose I have:
>
>
>
> #version 3.7;
> global_settings {assumed_gamma 1.0}
>
>
> #declare Scalar = array [5] {0, 1, 2, 3, 4}
> #declare Vector = array [5] {<0, 0, 0>, <1, 1, 1>, <2, 2, 2>, <3, 3, 3>, <4, 4,
> 4>}
> #declare String = array [5] {"A", "B", "C", "D", "E"}
>
> #declare BigArray = array [3] {Scalar, Vector, String}
>
>
>
> How do I access one of the values in the sub-arrays through BigArray / in a
> single step ?
> It doesn't appear that there's a sensible syntax for that.
>
> #declare Var1 = BigArray[0];
> would only make Var1 the whole scalar array, and it's only a 1-dimensional array
> of 3 other arrays, so I can't use two bracketed values...
ARRAY_IDENTIFIER[N] returns an element of an array, but it also qualifies as an
identifier itself; so if that element happens to be an array as well, it also
qualifies as an array identifier. So to access an element of /that/, you can
simply prepend another set of brackets.
For instance, `BigArray[2][3]` should work fine, returning "D".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|