POV-Ray : Newsgroups : povray.general : Array? : Re: Array? Server Time
10 Aug 2024 03:22:44 EDT (-0400)
  Re: Array?  
From: Margus Ramst
Date: 10 Mar 2000 08:57:44
Message: <38C8FFC7.E052DD8C@peak.edu.ee>
Bill DeWitt wrote:
> 
> Is there any further information on arrays in POV (besides the docs)?
> Specifically I would like to see ways of declaring array elements
> mathematically rather than manually. Perhaps in loops or with a formula.

Not sure what you mean, but here's an examlpe of what I'd call automatic
declaration:

#declare A=array[100]
#declare N=dimension_size(A,1); //Auto get the number of elements
#declare C=0;
#while(C<N)
  #declare A[C]=1;
  #declare C=C+1;
#end

This automatically initializes all array elements to 1.
You can of course replace 1 with an arbitrary formula etc etc.

Margus


Post a reply to this message

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