POV-Ray : Newsgroups : povray.advanced-users : 2D array definition Server Time: 12 Dec 2018 10:39:21 GMT
  2D array definition (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: 2D array definition
Date: 5 Nov 2018 14: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 18: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 17: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-2008 Persistence of Vision Raytracer Pty. Ltd.