//Files with predefined colors and textures #include "colors.inc" #include "glass.inc" #include "stones.inc" global_settings { max_trace_level 50} #declare epsilon = .0001; #declare light_loc_x = 0; #declare light_loc_y = 0; #declare light_loc_z = 100; #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 = 0; #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 = 0.8; #declare bubble_ior = 1.0; #declare bubloc_1x = 5; #declare bubloc_1y = 5; #declare bubloc_1z = 0; #declare bubloc_2x = -5; #declare bubloc_2y = 0; #declare bubloc_2z = 3; //Place the camera camera { // sky <0,0,1> //Don't change this // direction <-1,0,0> //Don't change this // right <-4/3,0,0> //Don't change this location <000,000,-500> //Camera location look_at <0,0,1> //Where camera is pointing angle 15 //Angle of the view--increase to see more, decrease to see less } //Ambient light to "brighten up" darker pictures global_settings { ambient_light White } //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 Black } // 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, 0>, <10, 10, 0>, 100, 100 //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 //===================================================================================== // Create Bubbles #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{ , (bubble_r) material{MatBubble} rotate } //end sphere (bubble) #declare Bubble_2 = sphere{ , (bubble_r) material{MatBubble} rotate } //end sphere (bubble) union { object {Bubble_1} object {Bubble_2} } //===================================================================================== //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) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! caustics 0.0 } // end of interior } // end of material rotate } // 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{ color rgbt<.99,.99,.99,0.98>} normal { bumps 0 scale 0.025 } finish { phong .001 } } // end of texture interior{ ior 1.405 dispersion 1.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! caustics 0.0 } // end of interior } // end of material } // 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{ color rgbt<.99,.99,.99,0.98>} normal { bumps 0 scale 0.025 } finish { phong .001 } } // end of texture interior{ ior 1.33 dispersion 1.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! caustics 0.0 } // end of interior } // end of material } // 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{ color rgbt<.99,.99,.99,0.98>} normal { bumps 0 scale 0.025 } finish { phong .001 } } // end of texture interior{ ior 1.495 dispersion 1.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1001 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! caustics 0.0 } // end of interior } // end of material } // End difference of outer water tube PlexCyl