POV-Ray : Newsgroups : povray.advanced-users : 2D array definition Server Time
22 Dec 2024 06:28:39 EST (-0500)
  2D array definition (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: 2D array definition
Date: 5 Nov 2018 09:10:00
Message: <web.5be04f2e51ae6718765e06870@news.povray.org>
I'd like to create a 2D array.
I know it can't be dynamic, so I need to declare it like
#declare array = array [m][n];

Do I _have_ to now define the _whole_ 2D array, or is there a syntax to define a
single "row" at a time?

#declare Array [3] = {n elements}; isn't allowed, but is there some functional
equivalent?  I'm drawing a blank.

I'll probably have to loop from  Array [3][0] to Array [3][n], won't I?


Post a reply to this message

From: Leroy
Subject: Re: 2D array definition
Date: 5 Nov 2018 13:30:01
Message: <web.5be08bb01e96ef561ccc53ba0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I'd like to create a 2D array.
> I know it can't be dynamic, so I need to declare it like
> #declare array = array [m][n];
>
> Do I _have_ to now define the _whole_ 2D array, or is there a syntax to define a
> single "row" at a time?
>
> #declare Array [3] = {n elements}; isn't allowed, but is there some functional
> equivalent?  I'm drawing a blank.
>
> I'll probably have to loop from  Array [3][0] to Array [3][n], won't I?

You could write a macro to this. But it would be easier just to loop through.


Post a reply to this message

From: jr
Subject: Re: 2D array definition
Date: 6 Nov 2018 12:55:09
Message: <web.5be1d4d31e96ef566427f7f90@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Do I _have_ to now define the _whole_ 2D array, or is there a syntax to define a
> single "row" at a time?

I'm sure you found a solution already.  fwiw I've just posted some code in
p.t.s-f (subject 'queues') which might be (might have been) useful.


regards, jr.


Post a reply to this message

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