POV-Ray : Newsgroups : povray.general : inverse used in nested loop error : Re: inverse used in nested loop error Server Time
9 Aug 2024 11:28:02 EDT (-0400)
  Re: inverse used in nested loop error  
From: Tor Olav Kristensen
Date: 5 Sep 2000 11:55:46
Message: <39B51636.42612FA9@online.no>
Bob Hughes wrote:

> Anyone mind trying to confirm this error?

As Thorstein already has located the error,
I will not comment on that.


I do not know what you are really doing
with your loops.

But if you are doing what I think you are
(placing objects in a 3D grid), then I have
a little suggestion for you below.

If I'm guessing wrong, then please disregard
this post.


Best regards,

Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


#declare AnyThing =
union {
  sphere { <0, 0, 0>, 2 }
  box { -1.5*<1, 1, 1>, 1.5*<1, 1, 1> }
}

// Nr of objects in each direction
#declare xNr = 21;
#declare yNr = 5;
#declare zNr = 1;

// Adjust to get different grid spacings
#declare vSpacing = <4, 4, 3>;

union {
  #declare zCnt = 0;
  #while (zCnt < zNr)
    #declare yCnt = 0;
    #while (yCnt < yNr)
      #declare xCnt = 0;
      #while (xCnt < xNr)
        object {
          AnyThing
          translate vSpacing*<xCnt, yCnt, zCnt>
        }
        #declare xCnt = xCnt + 1;
      #end // while
      #declare yCnt = yCnt + 1;
    #end // while
    #declare zCnt = zCnt + 1;
  #end // while
// Uncomment to translate grid centre to origo
//  translate vSpacing*(<1 - xNr, 1 - yNr, 1 - zNr>)/2
  pigment { color rgb 1.5*<1, 1, 1> }
}


Post a reply to this message

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