POV-Ray : Newsgroups : povray.advanced-users : Directly accessing array value in array of arrays (Part 2) : Re: Directly accessing array value in array of arrays (Part 2) Server Time
16 Apr 2024 13:52:44 EDT (-0400)
  Re: Directly accessing array value in array of arrays (Part 2)  
From: jr
Date: 27 Aug 2018 04:45:00
Message: <web.5b83b8fba75a4bf71500b2fd0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> #declare Array1 = array [4][4];
>
> #declare Array2 = array [4][4];
>
> Partially fill Array 2 with some values.
>
> #declare Array1 [2][3] = Array2;
>
> 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'm none to happy about it either.
>
> Advice?  Solution(s)?


assign Array1[2][3] to a variable, then access that like the array.  given the
above and the four elements of Array2[1][?] set to some value, the following
works for me:

#declare TA = Array1[2][3];

#debug concat("TA 1 2", str(TA[1][2], 0, 0), "\n")

hth.


regards, jr.


Post a reply to this message

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