POV-Ray : Newsgroups : povray.general : question : Re: question Server Time
7 Aug 2024 23:16:27 EDT (-0400)
  Re: question  
From: Arun Persaud
Date: 26 Apr 2001 12:35:58
Message: <3AE84EEF.C9D3B87F@lbl.gov>
Hi,

Dennis Milller 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.
> Any clues?

> #declare r1 = seed(13);
> #declare xcounter = 0;
> #while (xcounter < 50)
> #declare zcounter = 0;
> #while (zcounter < 50)
> box {<-.25,-.25,-.25>, <.25,.25,.25>
> 
>  translate <xcounter,rand(r1),zcounter>   // rand(r1)
>  pigment { color rgb <1,1,1> } finish {metallic}}
> 
> #declare zcounter = zcounter + 1;
> #end
> #declare xcounter = xcounter + 1;
> #end

you can't interchange them, because of the call to the
random-function...
if you interchange the xcounter and zcounter in the translate statement,
you are going to mirror your image on the x=z plane.
(e.g. if you compare the boxes with xcounter==zcounter in the two images
you will notice that they didn't change).

HTH
	ARUN


Post a reply to this message

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