POV-Ray : Newsgroups : povray.general : Macros : Re: Macros Server Time
12 Aug 2024 13:18:08 EDT (-0400)
  Re: Macros  
From: Spider
Date: 3 Feb 1999 20:50:13
Message: <36B8FBAE.DB83A451@bahnhof.se>
Start by doing a general while loop for it, something like :

#declare Numx = 10;
#declare Numy = 10;
#declare Numz = 10;
#declare Ny =0;
#while(Ny<Numy)
  #declare Nx =0;
  #while(Nx<Numx)
    #declare Nz=0;
    #while(Nz<Numz)
      sphere { <0,0,0>,1 pigment { White } translate
<-0.5*Nx,Ny,-0.5*Nz> }
      #declare Nz=Nz+1;
    #end
    #declare Nx=Nx+1;
  #end
  #declare Ny=Ny+1;
  #declare Numz=Numz-1;
  #declare Numx=Numx-1;
#end
and then when the loop works something resembling what you want, you
change the indata variables for the start parameters of a #macro, like
#macro place(Numx,Numy,Numz)
<insert code>
#end

Then ytou change it until it fits. in this case I'd make Num as a
vector, and use Num.x, num.y, Num.z in the macro...

Hope it helps.

note : This code is untested and is probably not what you were after.

//Spider


Post a reply to this message

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