// Last edited on 2010-10-15 13:51:05 by stolfilocal // Various balls. // Caller must define light_ambient (min 0.0 max 1.0) // All dimensions in millimeters // All balls are centered on the origin. #local eps = 0.01; // Fudge perturbation to avoid coincident surfaces. #macro BL_plastic_texture(bot_color, top_spec, top_rough) // Texture with Lambertian background of color {bot_color} and // polished varnish layer with intensity {top_spec} and roughness {top_rough}. texture{ pigment{ rgb bot_color/(1.0 - top_spec) } finish{ ambient light_ambient specular 0.00 diffuse (1.0 - light_ambient) } } texture{ pigment{ rgb <1,1,1> filter (1.0 - top_spec) } finish{ ambient 0.0 specular top_spec roughness top_rough diffuse 0.0 } } #end // UNPAINTED PING-PONG BALLS #declare BL_pong_ball_raw_radius = 20.0; // Ping-pong ball, including paint layer. #declare BL_pong_ball_raw_texture = BL_plastic_texture( < 0.950, 0.950, 0.950 >, // {bot_color}. 0.050, // {top_spec}. 0.050 // {top_rough}. ) #declare pong_ball_raw = // Unpainted ping-pong ball. sphere{ <0,0,0>, BL_pong_ball_raw_radius - eps texture{ BL_pong_ball_raw_texture } } // MATT-WHITE PING-PONG BALLS #declare BL_pong_ball_painted_radius = 20.2; // Ping-pong ball, including paint layer. #declare BL_pong_ball_white_texture = BL_plastic_texture( (0.98/0.82)*< 0.8182, 0.8182, 0.7941 >, // {bot_color}. 0.001, // {top_spec}. 0.005 // {top_rough}. ) #declare pong_ball_painted_white = // Unpainted ping-pong ball. sphere{ <0,0,0>, BL_pong_ball_painted_radius - eps texture{ BL_pong_ball_white_texture } } // SNOOKER BALLS #declare BL_snooker_ball_radius = 26.25; // Standard snooker balls. // BLACK SNOOKER BALL #declare BL_snooker_ball_black_texture = BL_plastic_texture( < 0.010, 0.010, 0.010 >, 0.900, 0.002 ) #declare snooker_ball_black = // Black snooker ball. sphere{ <0,0,0>, BL_snooker_ball_radius - eps texture{ BL_snooker_ball_black_texture } } // FUNNY-SIZE POOL BALLS #declare BL_funny_pool_ball_radius = 23.5; // Does not seem to be standard. // WHITE FUNNY POOL BALL #declare BL_funny_pool_ball_white_texture = BL_plastic_texture( (0.98/0.73)*< 0.7272, 0.6591, 0.4706 >, 0.900, 0.004 ) #declare funny_pool_ball_white = // White funny_pool ball. sphere{ <0,0,0>, BL_funny_pool_ball_radius - eps texture{ BL_funny_pool_ball_white_texture } }