POV-Ray : Newsgroups : povray.general : help w/simple macro : Re: help w/simple macro Server Time
9 Aug 2024 19:38:08 EDT (-0400)
  Re: help w/simple macro  
From: Tor Olav Kristensen
Date: 19 May 2000 19:14:05
Message: <3925CA25.AA9536C4@hotmail.com>
Tor Olav Kristensen wrote:
> 
> Below you find the code for my new suggestion.
> The "big" difference is the passing of the
> spike shape trough a variable; "Thing" to
> the macro.
> 
> (POV-Ray does not force you to do this, but
> I think this is good programming practice.)
> 

I forgot to mention that this enables you to 
have the macro accept other shapes too.

Now you can do things like this:


#declare Spike = cone { <0, 0, 0>, 0.2, <0, 1, 0>, 0 }

#declare Grid_1 = 
union {
  Make_Grid(Spike, 0.5, 6)
}

#declare Grid_2 = 
union {
  Make_Grid(sphere { y*0.8, 0.3 }, 0.5, 6)
}


difference {
  object { Grid_1 }
  object { Grid_2 }
  rotate 45*x
  translate 3*y
  pigment { color Red }
}


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


Post a reply to this message

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