|
|
Am 27.08.2018 um 01:22 schrieb Bald Eagle:
> I tracked down my old thread, but no help.
>
>
http://news.povray.org/povray.advanced-users/thread/%3Cweb.58e6aa331b66056880403a200%40news.povray.org%3E/
>
> I have a 2D array, and I want to have that array be a collection of other 2D
> arrays.
>
> Is that allowed?
Yes, absolutely - although I've heard rumors that /someone/ just
discovered a bug that may cause a crash instead of a parse error if
arrays of arrays are used and mistakes are made ;)
> How do I access, or more importantly assign, uninitialized "internal" 2D array
> elements?
>
> #declare Array1 = array [4][4];
>
> #declare Array2 = array [4][4];
>
> Partially fill Array 2 with some values.
>
> #declare Array1 [2][3] = Array2;
Perfectly fine there.
As a side note, it might be worth mentioning that `Array1[2][3]` now
holds a /copy/ of `Array2`, not a reference.
> So far so good - but now I need to get to the "array formerly known as Array2 ",
> element [0][2] which is INSIDE of Array1 [2][3]
>
> #declare Array1[2][3][0][2] = somevalue makes the POV-Ray parser cry.
I doubt that's what you're actually seeing, because that exact construct
works perfectly fine here.
Post a reply to this message
|
|