/* POVRAY PROGRAM TO CREATE THE VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING WHICH COMPRISES LINKED ELLIPSOIDS IN A TRIPLE CASHEW-NUT CONFIGURATION By ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor triangle1.pov +W640 +H480 set width and height of picture in /etc/povray/3.6/povray.ini */ #include "colors.inc" #include "shapes.inc" #include "textures.inc" global_settings{max_trace_level 256} //max possible is 256 #declare G = 1.6180339887; //golden ratio #declare oh = 195; //hypotenuse distance to observer 3 for internal view #declare rd = 25; //angle of elevation to observer 0 for internal view #declare Height = oh * sind(rd); #declare Dist = oh * cosd(rd); camera{ location<0, Height, Dist> look_at <0, 0, 0> angle 13 //angle 13 for external and 60 for internal views } light_source{<0,Height,Dist> color rgb <.5,.5,.5>} //camera light #declare fr=79.788456088; //radius of 2-hectare gleba (metres) light_source { //SUN <0, 1000, 0> //located at south horizon color rgb <.7,.7,.5> //reddish-yellow light cylinder //confined to a cylindrical beam radius fr //radius at full intensity falloff 10000 //falling off to 0 brightness at 1000 units radius area_light <1,0,0>, <0,0,1>, 20,20 //lighting element is a 20 x 20 pixels adaptive 1 //the normal of which is determined by the vectors jitter //adaptive = minimise number of test rays required point_at <0, 0, 0> //light beam is aimed at the co-ordinate origin rotate <30,0,-15> //rotate sun to desired position in the sky } //ENVIRONMENT --------------------------------------------------------- #declare ground_level = -3; //amount ground is below co-ordinate origin #declare md = -7000; //mountains are 5km away #declare rp = 6378140; //Earth radius sphere{<0,0,0>, rp //create spherical planet texture{ //define its ground texture that comprises: pigment{color rgb <0.85, 1.0, 0.6>} finish{diffuse 0.2 ambient 0.5} } //translate it downwards to ground level translate<0, ground_level - rp, 0> } sky_sphere{ pigment{ gradient y color_map{ [(1 - cos(radians( 30))) / 2 color White ] [(1 - cos(radians(120))) / 2 color Blue ] } scale 2 translate -1 } } // GLEBA CIRCLE ------------------------------------------------------ #declare gleba_height = .002; //gleba is 5 mm above ground level cylinder { <0, 0, 0>, <0, gleba_height, 0>, 1 // thin cylinder of unit radius texture { //define its texture that comprises: pigment { onion color_map { [0.0 color Yellow] // starts at yellow, then blend through to [1.0 color rgb <0.815, 1.015, 0.51>] //field-green } } finish { //with surface characteristics: diffuse 0.2 //diffusion ambient 0.5 //effective ambient lighting (brightness) } } translate <0,ground_level,0> //move gradiented circle down to ground level scale //rescale to size of 2-hectare gleba } // TEXTURES ----------------------------------------------------------- #declare X = 0.80; #declare Y = 0.55; #declare Z = 0.55; #declare W = 0; #declare SC1O = texture { pigment { color rgb } //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.35 } } #declare SC2O = texture { pigment { color rgb } //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.35 } } #declare SC3O = texture { pigment { color rgb } //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.4 } } #declare SC4O = texture { pigment { color rgb } //, 0.15> } // dark grey finish { phong 0.8 ambient 0.35 } } #declare tp = 0.5; //transparency #declare SC1T = texture { pigment { color rgb <0.55, 0.51, 0.47, tp>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare SC2T = texture { pigment { color rgb <0.47, 0.55, 0.51, tp>} //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.6 } } #declare SC3T = texture { pigment { color rgb <0.47, 0.51, 0.55, tp>} //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.6 } } #declare glas = texture{ pigment{color rgb <0.7, 0.7, 0.8, 0.85>} //glass for windows finish{phong 0.9 ambient 0.5} } #declare invisible = texture{pigment{color rgbt<1,1,1,1>}} // NINHO ------------------------------------------------------------------- #declare A = 4; //horizontal radius of ellipsoid #declare R = 1; //inter-unit extended radius before scaling #declare S = sphere{<0, 0, 0>, 1} #declare G = 1; //minor radius of torus /* corridor height g = 2 g**2 = 4 h = sqrt(g**2 - 1) = sqrt(3) = 1.732050808 h - G = 0.732050808 vertical unit = 1.464101615 metres corridor outer height = 2.464101615 metres */ #declare U = 1.1; //separation between units that don't touch #declare g = 1 + G; // 2 #declare h = sqrt(g*g - U*U);//major radius of torus U**2 = 1.21 h = sqrt(4 - 1.21) = 1.670329309 #declare r = h/g; //radius of cutting cylinder = 0.835164654 #declare q = sqrt(1 - r*r); //sqrt(1-0.6975)=0.3025 (POVRAY calculates it as sqrt(-0.302500)(why?) #declare L = U - q; //half-length of cutting cylinder // r**2 = 0.6975 r = 0.835164654 #declare T = torus{h, G clipped_by{cylinder{<0,L,0>, <0,-L,0>, r}} rotate<0,0,90> } #declare S1 = union{ object{S} //ellipsoid object{S translate<2*U,0,0>} //second ellipsoid object{T translate} //torus corridor joining them translate<0,0,U/cosd(30)> //move out to periphery } /* tunnel vertical radius = h - G = 0.732050808 at full scale = 1.464101615 at pre-scaling of tunnel = */ #declare tr = 0.183012702; //tunnel radius before scaling to full size #declare S2 = merge{ //4-ellipsoid semi-circle object{S1} //main ellipsoid-pair object{S1 //second ellipsoid-pair translate<-U,0,2*U*cosd(30)> rotate<0,120,0> } object{T //extra torus section corridor translate rotate<0,60,0> } cylinder{ //tunnel section <-3,0,0>, <+3,0,0>, tr scale<1,4,1> translate<0,0,U*tand(30)> rotate<0,60,0> } cylinder{ //tunnel section <0,0,0>, <-2,0,0>, tr scale<1,4,1> translate<0,0,U/cosd(30)> } } #declare FOOT = cylinder{<0,-2,0>, <0,0,0>, 0.5 translate<0,0,U/cosd(30)>} #declare ninho = merge{ merge{object{S2} object{FOOT} texture{SC1O}} merge{object{S2} object{FOOT} rotate<0,120,0> texture{SC2O}} merge{object{S2} object{FOOT} rotate<0,240,0> texture{SC3O}} scale } object{ninho rotate<0,13,0> translate<0,0,-0.75>}