POV-Ray : Newsgroups : povray.advanced-users : Break out of main while (1) loop using #break directive in a sub-loop state= : Re: Break out of main while (1) loop using #break directive in a sub-loop s= Server Time
4 Feb 2023 23:33:02 EST (-0500)
  Re: Break out of main while (1) loop using #break directive in a sub-loop s=  
From: Bill Pragnell
Date: 16 Jan 2023 17:05:00
Message: <web.63c5c9e242c56c9cb96893c06f35e431@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> One thing that I did run across that is being used in this code, but isn't
> natively supported by SDL is the referencing of a 1D "slice" of a 2D array.
>
> "Although it is permissible to reference an entire array as a whole, you may
> not reference just one dimension of a multi-dimensional array."

You can kind-of do this in SDL, but only if you use arrays of arrays instead of
multi-dimensional arrays. So, instead of

#declare A = array[3][2];

use

#declare A = array[3];
#for (I, 0, 2)
 #declare A[I] = array[2];
#end

which may or may not be more trouble depending on how you're populating the
arrays. However, it is indexed in exactly the same way - A[I][J] - and you can
indeed reference A[I] as an array[2].

Bill


Post a reply to this message

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