|
![](/i/fill.gif) |
"D103" <nomail@nomail> wrote:
.....
> The other reason I posted was to ask if there was a way to reduce the process of
> creating the vectors for the patches to a while loop or nested loops.
.....
>
> D103
After some experimentation, I have come up with these loops.
The idea is of course, to replace the sphere with an array or to place the loops
within an array, whatever is necessary.
#declare X1=-1.5; //in the scene file these are equal to the v_length of the
appropriate values.
#declare Z1=-1.5;
#declare Cnt=0;
#while(X1<=1.5)
#while(Z1<=1.5)
#if(Cnt>=15)
#debug "Cnt = illegal value.\n"
#else
#debug "Cnt is within legal range.\n"
#end
//#declare Pts[Cnt]=<X1, 0, Z1>;
sphere { 0, 0.1 pigment { White } translate <X1, 0, Z1> }
#declare Z1=Z1+1;
#declare Cnt=Cnt+1;
#end
For some reason, when I run this in POV-Ray, it only creates one sphere, (or
else several spheres in the same location), and when the sphere is replace with
an array, the first point is generated alright, but on the second loop, it
produces an error message: "attempt to access uninitialized array element".
#declare X1=X1+1;
#declare Z1=-1.5;
#end
If someone could point out the problem(s), I would be very grateful.
Thanks,
D103
Post a reply to this message
|
![](/i/fill.gif) |