#declare R = seed(2.342); #macro Moon(minsize, maxsize, color1, color2) #if (color1.x+color1.y+color1.z=0) #local R1 = rand(R)+0.5; #local G1 = rand(R)+0.5; #local B1 = rand(R)+0.5; #local color1 = rgb; #end #if (color2.x+color2.y+color2.z=0) #local R2 = rand(R)+0.5; #local G2 = rand(R)+0.5; #local B2 = rand(R)+0.5; #local color2 = rgb; #end #local PMoonMare=pigment { wrinkles turbulence 0.2 scale 0.5 color_map { [0 color color1] [1 rgb 0] } } #local PMoonCraters= pigment { granite scale 0.2 color_map{ [0 color color2] [1 rgb 0] } } #local TMoon= texture{ pigment { average pigment_map{ [0.5 PMoonMare] [0.5 PMoonCraters] } scale minsize + rand(R)*maxsize translate *100 } finish {ambient 0.001 diffuse 0.9} } #local S=rand(R)*(maxsize-minsize)+minsize; #local Moon1=sphere { 0,S texture {TMoon } } object{Moon1} #end /* Call it like this: object{Moon(100,500,<0,0,0>,<0,0,0>) translate... rotate...} Sending in a Black <0,0,0> color will randomize the moon colors. Passing in any other colors will make it use the colors you send in. */