POV-Ray : Newsgroups : povray.advanced-users : Multidimensional arrays Server Time
18 May 2024 05:07:24 EDT (-0400)
  Multidimensional arrays (Message 1 to 3 of 3)  
From: Andrew Coppin
Subject: Multidimensional arrays
Date: 15 Oct 2003 08:56:09
Message: <3f8d43e9$1@news.povray.org>
Quoting the POV-Ray manual, section 6.1.8.1:

"Although it is permissible to reference an entire array as a whole, you may
not reference just one dimension of a multi-dimensional array."

Naturally enough, this is EXACTLY what I want to do... Why does this
limitation exist? How do I get round it?

Thanks.
Andrew.


Post a reply to this message

From: ABX
Subject: Re: Multidimensional arrays
Date: 15 Oct 2003 09:41:48
Message: <84hqov0fh64rtkpfik2q6m82v07qc2j2k6@4ax.com>
On Wed, 15 Oct 2003 13:52:48 +0100, "Andrew Coppin" <orp### [at] btinternetcom>
wrote:
> Naturally enough, this is EXACTLY what I want to do... Why does this
> limitation exist? How do I get round it?

Instead of defining multidimensional array, define array of arrays:

#local Array1 = array[2][3]; // mutidimensional array

#local Array2 = array[2];
#local Array2[0] = array[3];
#local Array2[1] = array[3];

Now you can reference one dimension of array as well as whole array and each
element.

ABX


Post a reply to this message

From: Andrew Coppin
Subject: Re: Multidimensional arrays
Date: 15 Oct 2003 11:02:46
Message: <3f8d6196@news.povray.org>
> > Naturally enough, this is EXACTLY what I want to do... Why does this
> > limitation exist? How do I get round it?
>
> Instead of defining multidimensional array, define array of arrays:
>
> #local Array1 = array[2][3]; // mutidimensional array
>
> #local Array2 = array[2];
> #local Array2[0] = array[3];
> #local Array2[1] = array[3];
>
> Now you can reference one dimension of array as well as whole array and
each
> element.

Curiose... That should be in the docs!

Thanks.
Andrew.


Post a reply to this message

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