global_settings { assumed_gamma 1.0 max_trace_level 5 } camera { location <0, 10, -25> direction z right x*image_width/image_height look_at <0, 1, 0> } // Parameters: // + name of the image to map (string) // + type of the image to map (string) // + luminosity curve exponent (integer) // + amount of ambient light (float) // + amount of filter for the image shell (float) #macro pseudoHDRI_sphere(map_name,map_kind,sun_ambient,sun_exponent,light_ambient,light_filter) // declare image pigments #local p_image= pigment{ image_map{ // these are only the types I use... #if (strcmp(map_kind,"jpeg")=0) jpeg map_name #end #if (strcmp(map_kind,"png")=0) png map_name #end #if (strcmp(map_kind,"tga")=0) tga map_name #end #if (strcmp(map_kind,"ppm")=0) ppm map_name #end map_type 1 interpolate 2 // perhaps innecesary for some maps } } #local p_image_filtered= pigment{ image_map{ // these are only the types I use... #if (strcmp(map_kind,"jpeg")=0) jpeg map_name #end #if (strcmp(map_kind,"png")=0) png map_name #end #if (strcmp(map_kind,"tga")=0) tga map_name #end #if (strcmp(map_kind,"ppm")=0) ppm map_name #end map_type 1 interpolate 2 // perhaps innecesary for some maps filter all light_filter } } // convert the image into a function of a image_map #local fp=function{pigment{p_image}} // environment object union{ sphere{0,1 hollow no_shadow texture{ pigment{ function{fp(x,y,z).gray} poly_wave sun_exponent color_map{ [0.0 rgb 0] [1.0 rgb 1] } } finish{diffuse 0 ambient sun_ambient} } } sphere{0,.999 hollow no_shadow texture{ pigment{p_image_filtered} finish{diffuse 0 ambient light_ambient} } } } #end // en of macro DRM //#declare sm_file="sm_jvp_office-sun-3.jpg" //#declare sm_file="veranda.jpg" //#declare sm_file="salonjour.jpg" //#declare sm_file="sky2.jpg" //#declare sm_file="sky1.jpg" #declare sm_file="sm_lotw-041119.jpg" //#declare sm_file="thekitchen-29.jpg" object{ pseudoHDRI_sphere(sm_file,"jpeg",5.0,100, 0.36,1) translate -0.15*y scale 10000 rotate 180*y-90*y } #declare table_size = 20; box { -, texture{ pigment{ gradient z color_map{ [0.0 rgb 0.5] [0.05 rgb 0.5] [0.05 rgb 1] [1.0 rgb 1] } scale 5*z translate 2*z } finish{ambient 0 diffuse 1} } texture{ pigment{ gradient x color_map{ [0.0 rgb 0.5] [0.05 rgb 0.5] [0.05 rgbt 1] [1.0 rgbt 1] } scale 5*x } finish{ambient 0 diffuse 1} } translate -0.01*y } #macro rouleau(height,out_radius,corner_radius) merge { torus { out_radius-corner_radius, corner_radius translate height*y-corner_radius*y } cylinder { height*y-2*corner_radius*y, height*y, out_radius-corner_radius } cylinder { corner_radius*y, height*y-corner_radius*y, out_radius } cylinder { 0, 2*corner_radius*y, out_radius-corner_radius } torus { out_radius-corner_radius, corner_radius translate corner_radius*y } } #end #declare hole_radius = 1.5; #declare max_radius = 4.0; #declare max_height = 4.0; #declare round_radius = 0.2; #declare space = 0.3; #macro the_obj(texture_body,texture_rouleau) union { object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x } object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x rotate 360/3*y } object { rouleau(max_height,hole_radius-space/2,round_radius) texture { texture_rouleau } translate max_radius/2*x rotate 360*2/3*y } merge { object { difference { rouleau(max_height,max_radius,0.2) cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x } cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x rotate 360/3*y } cylinder { -0.001*y, max_height*y+0.001*y, hole_radius translate max_radius/2*x rotate 360*2/3*y } } } torus { max_radius, 0.5 translate 0.5*y } texture { texture_body } } } #end #declare texture_rouleau_1 = texture { pigment { color rgb <0.9,0.6,0.6> } finish { ambient 0 diffuse 1 } } #declare texture_body_1 = texture { pigment { color rgb <0.6,0.6,0.9> } finish { ambient 0 diffuse 1 } } #declare texture_rouleau_2 = texture { pigment { color rgb <0.9,0.9,0.2> } finish { ambient 0 diffuse 1 } } #declare texture_body_2 = texture { pigment { color rgb <0.9,0.6,0.6> } finish { ambient 0 diffuse 1 } } #declare texture_rouleau_3 = texture { pigment { color rgb <0.6,0.9,0.6> } finish { ambient 0 diffuse 1 } } #declare texture_body_3 = texture { pigment { color rgb <160,96,204>/255 } finish { ambient 0 diffuse 1 } } object { the_obj(texture_body_1,texture_rouleau_1) } object { the_obj(texture_body_2,texture_rouleau_2) rotate 33*y rotate -27*z rotate -20*x translate 6.5*x+2.35*y translate -max_height/2*z } object { the_obj(texture_body_3,texture_rouleau_3) translate -max_height/2*y rotate 90*x rotate 180*y translate max_radius*y+0.35*y rotate -7*x translate -max_radius*2*x-0.3*x+max_height/2*z rotate -45*y }