//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 = 90; #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 = 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 <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 <0,0,-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, 10>, <10, 10, 10>, 100, 100 adaptive 1 jitter looks_like { light_box } } //————————————————————————————————————————————————————————————————————————————————————— // Creating bubbles that go into voids of gel //————————————————————————————————————————————————————————————————————————————————————— // Add Bubble Definitions Here: sphere{ <4.708,7.784,4.171>, (bubble_r) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1000 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) caustics 0.0 } // end of interior } // end of material rotate } sphere{ <1.862,29.796,-6.023>, (bubble_r) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1000 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) caustics 0.0 } // end of interior } // end of material rotate } sphere{ <-7.205,20.129,-3.448>, (bubble_r) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1000 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) caustics 0.0 } // end of interior } // end of material rotate } sphere{ <1.424,17.806,-9.772>, (bubble_r) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1000 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) caustics 0.0 } // end of interior } // end of material rotate } sphere{ <-5.249,17.494,-3.139>, (bubble_r) 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.0 // this simulates dispersion caused refraction dispersion_samples 7 fade_power 1000 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used!) caustics 0.0 } // end of interior } // end of material rotate } //————————————————————————————————————————————————————————————————————————————————————— //Creating Glass Tube //————————————————————————————————————————————————————————————————————————————————————— //create hollow cylinder 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 1.0 //(0=off) (realistic: 1~2, >=1000 ->realistic exponential attenuation function will be used! caustics 0.0 } // end of interior } // end of material } // End Merge (Full tube) //————————————————————————————————————————————————————————————————————————————————————— // Creating Gel to fill Glass Tube with voids for the bubbles //————————————————————————————————————————————————————————————————————————————————————— // Creating gel to fill glass difference{ 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 1 //(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) // Add Bubble Voids Here: sphere{ <4.708,7.784,4.171>, bubble_r rotate } //end sphere (bubble) sphere{ <1.862,29.796,-6.023>, bubble_r rotate } //end sphere (bubble) sphere{ <-7.205,20.129,-3.448>, bubble_r rotate } //end sphere (bubble) sphere{ <1.424,17.806,-9.772>, bubble_r rotate } //end sphere (bubble) sphere{ <-5.249,17.494,-3.139>, bubble_r rotate } //end sphere (bubble) } // End diffrence for bubbles //————————————————————————————————————————————————————————————————————————————————————— // Creating Water Cylinder around tube //————————————————————————————————————————————————————————————————————————————————————— 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 1 //(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 //————————————————————————————————————————————————————————————————————————————————————— //Creating Plexiglass Cylinder holding water //————————————————————————————————————————————————————————————————————————————————————— 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 1 //(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