POV-Ray : Newsgroups : povray.general : Tutorial for macros and arrays? : Re: Tutorial for macros and arrays? Server Time
13 Aug 2024 01:17:56 EDT (-0400)
  Re: Tutorial for macros and arrays?  
From: Spider
Date: 8 Dec 1998 06:57:36
Message: <366D138A.4820E9A0@bahnhof.se>
Hello.
The best way of learning macros are to use them.

#declare MyArray = array[5] {4,3,2,1,0}
That declares an array of 5 posts(0-4).

#macro MyMacro(param)
  sphere {
    <0,0,0>
    param
  }
#end

declares a macro. To use it, simply call MyMacro from inside a object {}(or any CSG)
statement.

object {
  MyMacro(0.5)
  pigment { colour rgb 1 }
}
It does not use the macro as an function, instead, it inserts the macro at every
statement, with the parameters defined as in the macro call. 

hope it helps,
//Spider


David Etter Perere wrote:
> 
> hello,
> 
> As I'm not programmer I did learn a lot reading Sonya Roberts's Rendering
> Times POVabilities (http://www.spake.org/rtimes/article/povindx.htm). This
> tutorial is really great for a guy like me using specially a modeller who
> needs to discover more.
> 
> But since spring '98, this page didn't change. Now with the new features of
> version 3.1 like arrays and macros, the doc of Povray is not enough clear
> to help me to understand what means for exemple the scene files of the
> excellent "Running" -winner in the last IRTC.
> 
> Well, does anybody knows about such tutorial on the net or anywhere else
> (even better in french)?
> 
> Thank's
> --
> per### [at] bofinfomaniakch
> remove the "bof." to answer


Post a reply to this message

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