POV-Ray : Newsgroups : povray.general : question : Re: question Server Time
7 Aug 2024 23:22:31 EDT (-0400)
  Re: question  
From: Dennis Milller
Date: 26 Apr 2001 20:19:10
Message: <3ae8bafe@news.povray.org>
Ah, I see. So z is happening "inside" x in fact. That makes perfect sense.
Thanks very much.
D.

"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-155A75.11261926042001@news.povray.org...
> In article <3ae8369d$1@news.povray.org>, "Dennis Milller"
> <dhm### [at] mediaonenet> wrote:
>
> > I came across this code and have on question. If the xcounter and
zcounter
> > are identical, why can't they be interchanged in the translate
statement?
> > The image changes dramtically if I substite "zcounter" for "xcounter" or
> > vice versa, yet the "declare statements seem to do exactly the same
thing.
>
> Because they are *not* identical. Indenting the code properly makes it
> clearer:
>
> #declare xcounter = 0;
> #while (xcounter < 50)
>     #declare zcounter = 0;
>     #while (zcounter < 50)
>         ...
>         #declare zcounter = zcounter + 1;
>     #end
>
>     #declare xcounter = xcounter + 1;
> #end
>
> The zcounter loop is completely independant of the xcounter loop, and
> loops from 0 to 49 *every time the xcounter loop goes through one loop*.
> The outer loop runs through 50 times, and for each loop the inner loop
> gets reset and runs through again.
> This has the effect of zcounter going from 0 to 49 while xcounter = 0,
> then again while xcounter = 1, and so on. They start out and end at the
> same values, but change at different times and rates.
>
> --
> Christopher James Huff
> Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
>
> <><


Post a reply to this message

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