// Persistence Of Vision raytracer version 3.1 sample file. // File by Dieter Bayer // Perspective camera example #version 3.7; #macro create_spectrum(nelems,bright, choix) #local elem=1; color_map{ #while(elem<=nelems) #local h = (elem-1)/(nelems-1); #local coh = 1.0 - h; #local Huered = 0.9 - (h/0.5); #local Hueblue = 1.0 - (coh/0.6); #if (Huered < 0.0) #local Huered = 0.0; #end #if (Hueblue < 0.0) #local Hueblue = 0.0; #end #local Huered=1.0 - (1.0-Huered)*(1.0-Huered); #local Hueblue=1.0 - (1.0-Hueblue)*(1.0-Hueblue); #local Huegreen = 1.0 - Huered - Hueblue; #local ybulge = -4.0*(h-0.1)*(h-0.6); #if (ybulge<0) #local ybulge=0; #end #local Huered = Huered+ybulge;// * 0.5; // added * 0.5 #local Huegreen = Huegreen+ybulge; #switch(choix) #case (1) [bright, color rgb] #break case(2) [bright/(nelems/elem), color rgb] #break #case (3) [nelems/elem, color rgb] #break #case (4) [elem/bright, color rgb] #break #case (5) [bright/elem, color rgb] #break #else [bright, color rgb] #end #local elem=elem+1; #end } #end #declare RAD = 0; global_settings { assumed_gamma 1.52 #if (RAD = 1) radiosity { pretrace_start 0.08 pretrace_end 0.04 count 35 nearest_count 5 error_bound 1.8 recursion_limit 3 low_error_factor .5 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal on media on } #end } camera { location <-30, 22, -27> right <4/3, 0, 0> look_at <2, 6, 0> angle 90/1.2 } #if (RAD != 1) light_source { <0, 25, -10> //color rgb <1,1,0>*2 // create_spectrum(4, 1.7,2) spotlight // this kind of light source point_at <2.5, 0, 2.5> // direction of spotlight radius 50 // hotspot (inner, in degrees) tightness 5 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 60 // intensity falloff radius (outer, in degrees) } light_source { <200, 45, 200> color rgb <1,1,0>*2 //create_spectrum(4, 1.7,2) spotlight // this kind of light source point_at <250, 40, 205> // direction of spotlight radius 10 // hotspot (inner, in degrees) tightness 5 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 16 // intensity falloff radius (outer, in degrees) } light_source { <-1500,50,5000> color rgb 4.5 looks_like { sphere { 0*x, 50 pigment {color <1,1,0> } } } photons { refraction on reflection on area_light } } #end #declare My_Texture_1 = texture { pigment { color rgb <1, 0.75, 0.33> //filter 0.4 transmit 0.36 } finish { diffuse 0.51 phong 0 phong_size 0 reflection 0.125 } } #include "colors.inc" #include "CIE.inc" #include "rspd_jvp.inc" // material samples // ************************* // *** OLD BRUSHED METAL *** // ************************* // + microsurface normal #declare p_micro2= pigment{ crackle turbulence 1 color_map{ [0.00 White*.7] [0.01 White*.7] [0.02 White] [1.00 White] } scale 5 } #declare p_micro1= pigment{ cells turbulence .5 color_map{ [0.0 White*.9] [1.0 White] } scale .01 } // + average all the normals #declare p_brushed_new= pigment{ average turbulence 0 pigment_map{ [0.0 p_micro1] [0.1 p_micro1 rotate 45*x] [0.2 p_micro1 rotate -45*x] [0.3 p_micro2] [0.4 p_micro1 rotate 45*y] [0.5 p_micro1 rotate -45*y] [0.6 p_micro1 rotate 90*z] [0.7 p_micro2 rotate 45] [0.8 p_micro1 rotate 45*z] [0.9 p_micro1 rotate 90*y] [1.0 p_micro1 rotate -45*z] } scale .1 } #declare Metal = finish { ambient 0.1 brilliance 6 diffuse 0.7 metallic specular 0.80 roughness 1/120 reflection 0.8 } // + declare the final normal as image_pattern #declare n_brushed_new= normal{ pigment_pattern{p_brushed_new} .4} // + declare the final metal texture #declare t_metal= texture{ pigment{rgb ReflectiveSpectrum(RS_NordicGold1)} finish{ Metal } normal{n_brushed_new .5} } triangle { <50, -4, 50> <-50, -4, 50> <-50, -4, -50> texture { My_Texture_1 } texture { t_metal } } triangle { <50, -4, 50> <-50, -4, -50> <50, -4, -50> texture { My_Texture_1 } texture { t_metal } } #declare F1 = finish { diffuse 0.5 reflection 0.95 refraction on } #declare My_Texture_2 = texture { pigment { color rgb <1, 0.9, 0.7> filter 0.4 transmit 0.36 } finish {F1} } #declare R = 4; #declare S = 1; #declare P1 = pigment {rgbt <1,1,1,1>} #declare I1 = interior{ media{ emission 1 density{ //spherical cylindrical turbulence 0.321 density_map{ [0 rgb 0] [0.4 rgb <0,0,1>] [0.8 rgb <0,1,1>] [1 rgb 1] } } } } #declare I2 = interior{ media{ emission 1 density{ spherical density_map{ [0 rgb 0] [0.4 rgb <1,0,0>] [0.8 rgb <1,1,0>] [1 rgb 1] } } } } #local C = 10; #declare OB1 = union { sphere { 0,1 hollow pigment{P1} interior{I2} scale R translate <10,0,10> } sphere { 0,1 hollow pigment{P1} interior{I2} scale R translate <-10,0,-10> } sphere { 0,1 hollow pigment{P1} interior{I2} scale R translate <10,0,-10> } sphere { 0,1 hollow pigment{P1} interior{I2} scale R translate <-10,0,10> } sphere { 0,1 hollow pigment{P1} interior{I1} scale R translate <-10,20,-10> } sphere { 0,1 hollow pigment{P1} interior{I1} scale R translate <+10,20,-10> } sphere { 0,1 hollow pigment{P1} interior{I1} scale R translate <-10,20,+10> } sphere { 0,1 hollow pigment{P1} interior{I1} scale R translate <+10,20,+10> } cylinder { <-C, 0, -C>, <+C, 0, -C>, S texture { My_Texture_2 } } cylinder { <+C, 0, -C>, <+C, 0, +C>, S texture { My_Texture_2 } } cylinder { <+C, 0, +C>, <-C, 0, +C>, S texture { My_Texture_2 } } cylinder { <-C, 0, +C>, <-C, 0, -C>, S texture { My_Texture_2 } } cylinder { <-C, 20, -C>, <+C, 20, -C>, S texture { My_Texture_2 } } cylinder { <+C, 20, -C>, <+C, 20, +C>, S texture { My_Texture_2 } } cylinder { <+C, 20, +C>, <-C, 20, +C>, S texture { My_Texture_2 } } cylinder { <-C, 20, +C>, <-C, 20, -C>, S texture { My_Texture_2 } } cylinder { <-C, 0, -C>, <-C, 20, -C>, S texture { My_Texture_2 } } cylinder { <-C, 0, +C>, <-C, 20, +C>, S texture { My_Texture_2 } } cylinder { <+C, 0, +C>, <+C, 20, +C>, S texture { My_Texture_2 } } cylinder { <+C, 0, -C>, <+C, 20, -C>, S texture { My_Texture_2 } } } object { OB1 finish {F1} photons{ target 1.40 // spacing multiplier for photons hitting the object refraction on reflection on } } #declare SKY = 1; #if (SKY=1) background { color rgb < 0.078 , 0.361 , 0.53>/4 } sky_sphere { pigment { agate rotate x*52 scale 150 color_map { [ 0.1 color rgb <0.0, 0.0, 0.0>] [ 0.5 color rgb <1.0, 1.0, 1.0>] [ 0.7 color rgb <0.0, 0.0, 0.0> filter 0.5] [ 1.0 color rgbf <0.8, 0.8, 0.8, 1.0> ] } } } sphere { 0, 5000 hollow pigment { bozo scale 4000 color_map { [ 0.0 color rgb <0.001,0.001,0.01> transmit 0.41 filter 0.5] [ 0.4 color rgb <0.0018,0.0018,0.008> filter 0.4 transmit 0.36 transmit 0.48] [ 1.0 color rgb <0,0,0> filter 0.5] } } finish { ambient 0.7 diffuse 0 } interior {ior 1.361} } #else background { color rgb < 0.01 , 0.011 , 0.01753>/4 } #end #declare Brass = color red 0.71 green 0.65 blue 0.26; #include "shapes.inc" #declare BLOC = union { difference { //difference { union { object {Round_Box (<20, -80, -20> <30, 40, 160>, 5, 1)} #local ys = -70; #while (ys<=32) box{<11,ys,-20> <24,ys+7,160> pigment {rgb 1}} box{<26,ys,-20> <38,ys+7,160> pigment {rgb 1}} #local ys = ys+19; #end } object { Round_Box (<13, 7, 50> <37, 33, 100>, 7, 1) rotate x*10 } object {Round_Box (<13, 7, 20> <37, 33, 40>, 7, 1) } object {Round_Box (<13, 7, 120> <37, 33, 140>,2,1)} cylinder {<13, -7, 20> <37, 33, 40>, 10} } object {Round_Cylinder(<0,4,110>, <41,4,110>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <0,4,110>} object {Round_Cylinder(<0,24,90>, <41,24,90>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <0,24,90>} object {Round_Cylinder(<0,24,70>, <41,25,70>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <0,24,70>} object {Round_Cylinder(<0,4,50>, <41,4,40>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <0,4,50>} object {Round_Cylinder(<23,39, 10>, <23,55,10>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,10>} object {Round_Cylinder(<23,39, 30>, <23,55,30>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,30>} object {Round_Cylinder(<23,39, 50>, <23,55,50>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,50>} object {Round_Cylinder(<23,39, 70>, <23,55,70>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,70>} object {Round_Cylinder(<23,39, 90>, <23,55,90>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,90>} object {Round_Cylinder(<23,39, 130>, <23,55,130>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,130>} object {Round_Cylinder(<23,39, -10>, <23,55,-10>, 1.3, 0.5, 1)} torus {1.5, 0.5 translate <23,55,-10>} rotate y*-20 translate <14,0,0> // pigment {color rgb <0.25,0.25,0.36>} pigment {color Brass} finish { ambient 0.1 diffuse 0.1 reflection 0.125 } // normal {agate 0.125 scale 0.25} } //object {BLOC} object { BLOC rotate y*90 scale <50,20,10> translate <200,-100,5000> normal {agate 0.125 scale 0.25} } object { BLOC rotate y*90 scale <50,20,10> translate <-5000,-100,5000> normal {agate 0.125 scale 0.25} } object { BLOC //rotate y*20 scale <10,20,50> translate <4500,-100,-1500> normal {agate 0.125 scale 0.25} } #macro Round_Bottom_Mace_1 ( // A round-bottom flask Neck_Base_Fillet_R, // = 0.50, // > 0 // radius of neck base fillet // Hohlkehle Bowl_R, // = 1.00, // base bowl radius Neck_R, // = 0.30, // neck radius Neck_L, // = 1.00, // 0=non; neck linear length Merge_On, // =1, // 1 for transparent materials, else: 0 ) #local D = 0.001; #if( Neck_Base_Fillet_R < D ) #debug concat("neck base fillet radius set to ",str(Neck_Base_Fillet_R,12,8),"\n", "should be > 0\n", "Set to 0.00001\n\n") #declare Neck_Base_Fillet_R = D; #end #local M1 = ; #local Y2 = sqrt( pow(Neck_Base_Fillet_R+Bowl_R, 2) - pow(M1.x, 2)); #local M2 = <0,-Y2,0>; #local XS = M1.x * Bowl_R/(Neck_Base_Fillet_R+Bowl_R); #local YS = M2.y * Neck_Base_Fillet_R/(Neck_Base_Fillet_R+Bowl_R); #local S = ; // calculation of real height #declare Total_Height_of_Mace = Y2 + Bowl_R + Neck_L; // base shape ------------------------------------------------------ #if ( Merge_On = 1) merge{ #else union{ #end difference{ cylinder{ <0,0,0>,<0,S.y,0>,S.x } torus{ M1.x, Neck_Base_Fillet_R } } sphere{ M2, Bowl_R } // neck ---------------------------------- #if (Neck_L > 0) cylinder { <0,-D,0> ,<0,Neck_L,0>, Neck_R } #end translate<0,-M2.y+Bowl_R,0> } #end #macro Round_Bottom_Flask_1 ( // A round-bottom flask Glass_D, // 0.004, // Neck_Fillet_R, // = 0.050, // > 0 //radius neck base fillet // Hohlkehle Bowl_Radius, // = 0.100, // base bowl radius Neck_Radius, // = 0.030, // neck radius Neck_Length, // = 0.100, // 0=non; neck linear length Merge_On, // =1, // 1 for transparent materials, else: 0 ) #local D = 0.001; #if( Neck_Fillet_R < D ) #debug concat("neck base fillet radius set to ",str(Neck_Fillet_R,12,8),"\n", "should be > 0\n", "Set to 0.00001\n\n") #declare Neck_Fillet_R = D; #end #declare D = 0.000001; #declare Glass_D = 0.004*1; #declare Neck_Fillet = 0.050*1; #declare Bowl_Radius = 0.100*1; #declare Neck_Radius = 0.030*1; #declare Neck_Length = 0.100*1; // Round_Bottom_Flask_1 #if ( Merge_On = 1) merge{ #else union{ #end difference{ object{ Round_Bottom_Mace_1 ( // A round-bottom flask // declares: Total_Height_of_Flask Neck_Fillet_R, // > 0 // neck base fillet // Hohlkehle Bowl_Radius, // base bowl radius Neck_Radius, // neck radius Neck_Length, // 0=non; neck linear length 1, // 1 for transparent materials, else: 0 ) hollow } object{ Round_Bottom_Mace_1 ( // A round-bottom flask // declares: Total_Height_of_Flask Neck_Fillet_R+Glass_D, // > 0 // neck base fillet // Hohlkehle Bowl_Radius-Glass_D, // base bowl radius Neck_Radius-Glass_D, // neck radius Neck_Length+0.001, // 0=non; neck linear length 0, // 1 for transparent materials, else: 0 ) hollow } } // neck brace torus{Neck_Radius+Glass_D,Glass_D translate<0,Total_Height_of_Mace,0> } } #end #declare Glass_Material = material{ texture{ pigment{ rgb <0.98, 0.98, 0.98> filter 0.895 } finish { diffuse 0.1 reflection 0.1 specular 0.8 roughness 0.0003 phong 1 phong_size 400 } } interior{ ior 1.45 //caustics 0.85 } } object{ Round_Bottom_Flask_1 ( // declares: Total_Height_of_Flask 0.004, // Glass_D, // 0.050, // Neck_Fillet, // > 0 //radius neck base fillet // Hohlkehle 0.100, // Bowl_Radius, // base bowl radius 0.030, // Neck_Radius, // neck radius 0.100, // Neck_Length, // 0=non; neck linear length 0, // Merge_On, // 1 for transparent materials, else: 0 ) material{ Glass_Material } photons{ target 4.40 // spacing multiplier for photons hitting the object refraction on reflection on } scale <1,1.25,1>*50 translate<2.0,-3.75,-22.00> } /* blob{ threshold 0.4 #local Nr = 0; #while (Nr < pi) sphere { 0,1.05, 0.8 pigment {color rgb <0.25,0.25,0.36>} translate //rotate <0,0,Nr*360/30> } #local Nr = Nr+0.01; #end scale <0.5,0.5,1> translate <0,0,-10> }*/ #declare ressort = blob { threshold 0.4 #local a = 0.85; #local b = 0.25; #local h = 0.25; #local st = -5*pi; //-4*pi #while (st < 5*pi) // 8*pi #local xa = a * cos(st); #local ya = b * sin(st); #local za = h * st; sphere { , 0.15, 0.8 } #local st = st +0.025; #end pigment {rgbt 1} hollow } object { ressort scale <1.7,3,1.7> rotate x*90 translate <-10,10,10> } object { ressort scale <1.7,3,1.7> rotate x*90 translate <10,10,-10> } object { ressort scale <1.5,3,1.5> rotate x*90 translate <-10,10,-10> } object { ressort scale <2,3,2> rotate x*90 translate <10,10,10> } difference { //union { object {Round_Box (<300, -120, 50> <340, 85, 150>, 1.5, 1)} #local ys = -110; #while (ys<=70) box{<290,ys,40> <310,ys+4,160>} #local ys = ys+7; #end pigment { color rgb<0.57,0.24,0.0> transmit 0.4 filter 0.36 } finish { ambient 0.1 diffuse 0.1 reflection 0.25 } normal {agate 0.125 scale 0.25} }