// Coordinate axes macro // Last edited on 2009-09-27 21:39:15 by stolfilocal #macro axis(rad,len,dir) // An axis arrow in the direction {dir}, unpainted. // rad = radius of shaft. // len = length of arrow, excluding tips. #local tlen = 7.5*rad; // length of tip. #local trad = 2.5*rad; // Base radius of tip. union{ cylinder{ <0,0,0>, (len - 0.99*tlen)*dir, rad } cone{ (len - tlen)*dir, trad, len*dir, 0 } } #end #macro axes(rad,len) // The three axes, as three arrows colored Redish, Greenish, and Bluish. // rad = radius of shafts. // len = length of arrows, excluding tips. union{ sphere{ <0,0,0>, sqrt(2)*rad texture{ pigment{ color rgb <0.50,0.50,0.50> } finish { diffuse 0.1 ambient 0.9 } } } object{ axis(rad,len,x) texture{ pigment{ color rgb <1.00,0.28,0.28> } finish { diffuse 0.1 ambient 0.9 } } } object{ axis(rad,len,y) texture{ pigment{ color rgb <0.00,0.83,0.00> } finish { diffuse 0.1 ambient 0.9 } } } object{ axis(rad,len,z) texture{ pigment{ color rgb <0.45,0.45,1.00> } finish { diffuse 0.1 ambient 0.9 } } } } #end