POV-Ray : Newsgroups : povray.newusers : #declare/Object coloring question : The macro itself :) Server Time
4 Nov 2024 12:59:18 EST (-0500)
  The macro itself :)  
From: Brent G
Date: 18 Sep 2003 15:11:15
Message: <3f6a0353@news.povray.org>
#macro MyTorus_Macro(Light_Color,Position)
#declare I=0;
#declare N=10;
#declare MyTorus = union {
         #while (I<N)
                 torus {1,0.1 rotate <90,0,0> rotate<0, I*360/N,0>}
                 #declare I=I+1;
         #end
         light_source{<0,.5,.5> rgb Light_Color}
         texture {
                 pigment {
                         color rgb <0.8,0.8,1.0>
                 }
                 finish{
                         diffuse 0.3
                         ambient 0.0
                         specular 0.6
                         reflection {
                                 0.8
                                 metallic
                         }
                         conserve_energy
                 }
         }
}
object{ MyTorus scale<.5,.5,.5> translate Position }
#end


//Call the macro with Color,Translate Position
MyTorus_Macro(Blue,<-1,.5,.7>)
MyTorus_Macro(Orange,<1,.5,0>)


Post a reply to this message

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