|
![](/i/fill.gif) |
Tor Olav Kristensen wrote:
>
> Now you just have to change your last #declare to this
>
> #declare Grid_1 =
> union {
> Make_Grid(.5, 2)
> rotate 45*x
> translate 3*y
> }
>
Now I have read your question thoroughly.
(as I should have done in the first place :)
And I have also tested your code.
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.)
#macro Make_Grid(Thing, spacing, size)
#local xCnt = 0;
#while (xCnt < size)
#local zCnt = 0;
#while (zCnt < size)
object {
Thing
translate spacing*<xCnt, 0, zCnt>
}
#local zCnt = zCnt + 1;
#end
#local xCnt = xCnt + 1;
#end
#end
#declare Spike = cone { <0, 0, 0>, 0.2, <0, 1, 0>, 0 }
#declare Grid_1 =
union {
Make_Grid(Spike, 0.5, 6)
pigment { color Yellow }
}
object {
Grid_1
rotate 45*x
translate 3*y
}
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
PS:
You can also have the macro apply changes
to the Thing object with #declare.
E.g.: In the macro you can say
#declare Thing = object { Thing scale <1, 2, 1> }
And then after you have called the macro
the Spike will be twice as high as before.
Post a reply to this message
|
![](/i/fill.gif) |