//Files with predefined colors and textures //+w540 +h640 +a0.3 +am2 +bm2 +bs8 +wt7 #version 3.8; #include "colors.inc" #include "glass.inc" #include "stones.inc" global_settings { assumed_gamma 1.0 max_trace_level 50 radiosity { pretrace_start 16/max(image_width,image_height) pretrace_end 4/max(image_width,image_height) count 50, 1000 // higher -> higher quality (1..1600) [35] nearest_count 10, 5 // higher -> higher quality (1..10) [5] error_bound 1 // higher -> smoother, less accurate [1.8] recursion_limit 2 // how much interreflections are calculated (1..5+) [2] low_error_factor .3 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] maximum_reuse 0.1 // new parameter 3.7 [0.2] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 normal off // take surface normals into account [off] media off // take media into account [off] always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } #declare epsilon = .0001; #declare light_loc_x = -50; #declare light_loc_y = 100; #declare light_loc_z = -110; #declare tube_base = -55; #declare tube_height = 92; #declare tube_rinner = 13; #declare tube_router = 16; #declare tube_lip_width = 2; #declare tube_rotation_x = 0; #declare tube_rotation_y = 2*clock; #declare tube_rotation_z = 0; #declare water_router = 25.4; #declare plexi_router = 31.75; #declare gel_height = 0.9*tube_height; #declare bubble_r = 1.5;//0.8; #declare bubble_ior = 1.0; #declare bubloc_1x = 12; #declare bubloc_1y = 30; #declare bubloc_1z = 0; #declare bubloc_2x = 10; #declare bubloc_2y = 0; #declare bubloc_2z = 0; //Place the camera camera { sky y direction 1.0*z right image_width/image_height location <0, 0, -500> look_at <0, 0, 0> angle 35 } //Place a light--you can have more than one! //light_source { // <4,6,-10> //Change this if you want to put the light at a different point // color White*5 //Multiplying by 2 doubles the brightness //} //Set a background color background { color rgb 0.1 } plane {y, tube_base-tube_router-epsilon pigment {rgb <0.45,0.4,0>} normal {granite 0.1 scale 0.01} finish {diffuse 0.7 specular 0.2 roughness 0.001}} plane {y, 0.0 pigment {rgb <0.5,0.5,0.5>} normal {granite 0.1 scale 0.01} finish {diffuse 0.7 specular 0.2 roughness 0.001} rotate -90*x translate 150*z} // Set up light source from box #declare light_box = box { <-80,-100,0>, <80,100,2> pigment{color White} } //end light box //light_source{ // // <0,1,0> // color White // looks_like {light_box} // // } // End Light source as light box light_source { color White //area_light <-10, -10, 10>, <10, 10, 10>, 100, 100 //adaptive 1 //jitter //looks_like { light_box } } //===================================================================================== // Creating bubbles that go into voids of gel //===================================================================================== #declare MatBubble = material { texture { pigment {color rgbt<.99,.99,.99,0.98>} normal { bumps 0 scale 0.025 } finish { phong .001 } } // end of texture interior{ ior bubble_ior dispersion 1.01 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) } // end of interior } // end of material // Add Bubble Definitions Here: #declare Bubble_1 = sphere { <4.708,7.784,4.171>, (bubble_r) hollow material {MatBubble} rotate } #declare Bubble_2 = sphere { <1.862,29.796,-6.023>, (bubble_r) hollow material {MatBubble} rotate } #declare Bubble_3 = sphere { <-7.205,20.129,-3.448>, (bubble_r) hollow material {MatBubble} rotate } #declare Bubble_4 = sphere{ <1.424,17.806,-9.772>, (bubble_r) hollow material {MatBubble} rotate } #declare Bubble_5 = sphere{ <-5.249,17.494,-3.139>, (bubble_r) hollow material {MatBubble} rotate } union { object {Bubble_1} object {Bubble_2} object {Bubble_3} object {Bubble_4} object {Bubble_5} } //===================================================================================== //Creating Glass Tube //===================================================================================== //create hollow cylinder #declare GlassTube = merge { difference { //Create single cylinder cylinder {<0,(tube_base-epsilon),0>, <0,tube_height,0>, tube_router} // end cylinder cylinder {<0,(tube_base-2*epsilon),0>, <0,tube_height+epsilon,0>, tube_rinner} // end cylinder } // End difference (hollow cylinder) //create hollow half-sphere difference { difference { //Create single cylinder sphere {<0,0,0>, tube_router} // end sphere sphere {<0,0,0>, tube_rinner} // end sphere } // End difference (Hollow Sphere) box { <-2* tube_router ,0,-2* tube_router >, < 2*tube_router , 2*tube_router ,2* tube_router > } // End Box translate<0,tube_base,0> } // End Difference (Half-Sphere) // create Lip torus at top of tube torus { (tube_router+ tube_rinner)/2, tube_lip_width translate <0,tube_height,0> } // End Torus (Tube Lip) hollow material { texture { pigment { color rgbt<.99,.99,.99,0.99>} normal { bumps 0 scale 0.025 } finish { phong .99 } } // end of texture interior { ior 1.56 dispersion 1.01 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! fade_distance 40 } } // end of material } // End Merge (Full tube) GlassTube //===================================================================================== // Creating Gel to fill Glass Tube with voids for the bubbles //===================================================================================== // Creating gel to fill glass #declare GelCyl = merge { sphere {<0,tube_base,0>, tube_rinner-epsilon} // end sphere cylinder {<0,tube_base,0>, <0,gel_height,0>, tube_rinner-epsilon}// end cylinder material { texture { pigment {rgbt <.99, .99, .99, 0.98>} //normal { bumps 0 scale 0.025 } //finish { phong .001 } } // end of texture interior { ior 1.405 fade_color rgb <0.3, 0.9, 0.1>//desired colour dispersion 1.01 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! fade_distance 30 media { intervals 1 samples 50 //scattering {1, rgb <0.1, 0.9, 0.1>*1} absorption rgb 1-(<0.1, 0.9, 0.1>*0.1) } } // end of interior } // end of material //hollow } // end merge (gel matrix) GelCyl //===================================================================================== // Creating Water Cylinder around tube //===================================================================================== #declare WaterCyl = difference { cylinder {<0,tube_base-tube_router,0>,<0,tube_height*.8,0>, water_router} //End outer cylinder merge { cylinder {<0,tube_base,0>, <0,tube_height+epsilon,0>, tube_router} // end cylinder for glass tube sphere {<0,tube_base,0>, tube_router} // end sphere (tube bottom) } //end merge (glass tube inside of water material { texture { pigment {rgbt <.99, .99, .99, 0.98>} //normal {bumps 0 scale 0.025 } //finish {phong .001 } } // end of texture interior { ior 1.33 fade_color rgb <0.9, 0.3, 0.1>//desired colour dispersion 1.01 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! fade_distance 30 media { intervals 1 samples 50 //scattering {1, rgb <0.1, 0.9, 0.1>*1} absorption rgb 1-(<0.9, 0.3, 0.1>*0.1) } } // end of interior } // end of material //hollow } // End difference of outer water tube WaterCyl //===================================================================================== //Creating Plexiglass Cylinder holding water //===================================================================================== #declare PlexCyl = difference { cylinder {<0,tube_base-tube_router,0>,<0,tube_height*.9,0>, plexi_router} //End outer cylinder cylinder {<0,tube_base-tube_router-epsilon,0>,<0,tube_height*.9+epsilon,0>, water_router+2*epsilon} //End outer cylinder material { texture { pigment {rgbt <.99, .99, .99, 0.98>} normal {bumps 0 scale 0.025 } finish {phong .001 } } // end of texture interior{ ior 1.495 dispersion 1.01 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! fade_distance 40 } // end of interior } // end of material hollow } // End difference of outer water tube PlexCyl