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
20 Apr 2024 03:10:49 EDT (-0400)
  Re: Break out of main while (1) loop using #break directive in a sub-loop s=  
From: Bill Pragnell
Date: 18 Jan 2023 18:25:00
Message: <web.63c87f5842c56c9cb96893c06f35e431@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> That is very clever, and will go into my 'bag of tricks'. Thanks.

The best part is that the sub-arrays don't all need to be the same size.

#declare A = array[3];
#declare A[0] = array[4];
#declare A[1] = array[9];
#declare A[2] = array[16];

and if you don't know how big they are, e.g. you've got some macro that fills
them for you, you can just do

#for (I, 0, 2)
 #declare N = dimension_size(A[I], 1);
 #for (J, 0, N-1)
  // do mad pov stuff with A[I][J]
 #end
#end


Bill


Post a reply to this message

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