#version 3.7; // --- Global Settings --- global_settings { assumed_gamma 1.0 // Recommended for 3.7+ to ensure consistent lighting max_trace_level 5 // Depth of ray reflections } // --- Camera --- camera { location <0, 4, -5> // Position: x, y, z (Back and up) look_at <0, 0.5, 0> // Pointing at: x, y, z right x*image_width/image_height // Correct aspect ratio } // --- Light Source --- light_source { <10, 10, -10> // Position of the light color rgb <1, 1, 1> // White light } // --- Background --- background { color rgb <0.2, 0.3, 0.4> } #declare Radius = .05; #declare Min = -30; #declare Max = 30; // --- Ground Plane --- difference { plane { y, 0 // Surface normal y, distance from origin 0 } #for (Rot, 0, 2) union { #for (Shift, Min, Max) cylinder { < Min, 0, Shift>, < Max, 0, Shift>, Radius } #end rotate < 0, Rot*60, 0 > } #end #for (Rot, 0, 2) union { #for (Shift, Min, Max) cylinder { < Min, 0, Shift/sqrt(3)>, < Max, 0, Shift/sqrt(3)>, Radius } #end rotate < 0, 30+Rot*60, 0 > } #end pigment { color rgb <0.7, 0.7, 0.7> } // Gray color finish { ambient 0.2 diffuse 0.8 } } union { sphere { < 0, 0, 0 >, Radius } sphere { < 2/sqrt(3), 0, 0>, Radius } sphere { < 1/sqrt(3), 0, 1>, Radius } cylinder { < 0, 0, 0 >, < 2/sqrt(3), 0, 0>, Radius } cylinder { < 1/sqrt(3), 0, 1 >, < 2/sqrt(3), 0, 0>, Radius } cylinder { < 1/sqrt(3), 0, 1 >, < 0, 0, 0>, Radius } cylinder { < 0, 0, 0 >, < 0, 2, 0>, Radius } cylinder { < 1/sqrt(3), 0, 1 >, < 1/sqrt(3), 2, 1>, Radius } cylinder { < 2/sqrt(3), 0, 0 >, < 2/sqrt(3), 2, 0>, Radius } sphere { < 0, 2, 0 >, Radius } sphere { < 2/sqrt(3), 2, 0>, Radius } sphere { < 1/sqrt(3), 2, 1>, Radius } sphere { < 1/sqrt(3), 2+sqrt(2)/2, 1/3>, Radius } cylinder { <0, 2, 0 >, < 1/sqrt(3), 2+sqrt(2)/2, 1/3>, Radius } cylinder { <2/sqrt(3), 2, 0 >, < 1/sqrt(3), 2+sqrt(2)/2, 1/3>, Radius } cylinder { <1/sqrt(3), 2, 1 >, < 1/sqrt(3), 2+sqrt(2)/2, 1/3>, Radius } cylinder { < 0, 2, 0 >, < 2/sqrt(3), 2, 0>, Radius } cylinder { < 1/sqrt(3), 2, 1 >, < 2/sqrt(3), 2, 0>, Radius } cylinder { < 1/sqrt(3), 2, 1 >, < 0, 2, 0>, Radius } pigment { color rgb <1, 0.2, 0.2> } // Red color finish { specular 0.6 // Shiny highlight reflection 0.2 // Reflective surface } } // --- 3D Object (Sphere) --- //sphere { // <0, 0.5, 0>, 0.5 // Center , Radius // pigment { color rgb <1, 0.2, 0.2> } // Red color // finish { // specular 0.6 // Shiny highlight // reflection 0.2 // Reflective surface // } //}