/* POVRAY PROGRAM TO CREATE THE VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING WHICH COMPRISES LINKED ELLIPSOIDS IN A TRUNCATED TRIANGLE CONFIGURATION By ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor triangle2.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 = 200; //hypotenuse distance to observer 3 for internal view #declare rd = 12; //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 = -4; //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.9; #declare Y = 0.3; #declare Z = 0.45; #declare JP = pigment{ julia <0.36, 0.25>, 26 // julia <0.360, 0.250>, 20 interior 1, 1 scale 3 color_map{[0.0 color rgb ] [0.2 color rgb ] [0.4 color rgb ] [1.0 color rgb ] [1.0 color rgb <0,0,0>]} } // end of pigment #declare SC0O = texture { pigment { JP } finish { phong 0.8 ambient 0.35 } } #declare ft = texture{ pigment{color rgb <0.5, 0.4, 0.3>} //floor finish{phong 0.9 ambient 0.5} } #declare glas = texture{ pigment{color rgb <0.7, 0.6, 0.6, 0.8>} //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 #declare U = 1.15; //separation between units that don't touch #declare UA = U * A; #declare V = U/cosd(30); #declare VA = UA/cosd(30); #declare w = UA*cosd(30); #declare g = 1 + G; // 2 #declare h = sqrt(g*g - U*U);//major radius of torus U**2 = 1.21 h = sqrt(4 - 1.44) = 1.6 #declare r = h/g; //radius of cutting cylinder = 0.8 #declare q = sqrt(1 - r*r); //sqrt(1 - 0.64) = 0.6 #declare L = U - q; //half-length of cutting cylinder /* corridor height h - G = 1.6 - 1 vertical unit = 0.6 metres Real semi-vertical_diameter of corridor casing = 1.2 metres corridor outer height from floor = 2.2 metres */ #declare T = torus{h, G clipped_by{cylinder{<0,L,0>, <0,-L,0>, r}} rotate<0,0,90> } #declare S0 = union{object{S} object{T translate} } #declare S1 = union{ object{S0} //ellipsoid object{S0 rotate<0,60,0> translate<2*U,0,0>} //second ellipsoid translate<0,0,V> //move out to periphery } #declare ROOMS = union{ //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<-U,0,0> translate<0,0,V> } object{T //extra torus section corridor translate<-U,0,0> rotate<0,60,0> translate<0,0,V> } object{T //extra torus section corridor translate<-U,0,0> rotate<0,-60,0> translate<0,0,V> } object{T //extra torus section corridor translate<-U,0,0> rotate<0,120,0> translate<0,0,V> } } //FLOORS #declare BOX = box{<-2,-1.17,-1>, <+2,-1,+1>} #declare BOX1 = object{BOX translate} #declare BOX2 = object{BOX translate<0,0,2*w>} #declare FLOOR = cylinder{ // unit floor <0,-1.3,0>, <0,-1,0>, A clipped_by{sphere{<0,0,0>, 1 scale}} } #declare FLOOR2 = object{FLOOR translate<0,0,2*UA>} #declare FLOORS = union{ object{FLOOR} object{FLOOR translate<2*UA,0,0>} object{FLOOR2 rotate<0,+30,0>} object{FLOOR2 rotate<0,-30,0>} object{BOX1} object{BOX1 rotate<0, -60,0>} object{BOX1 rotate<0,-120,0>} object{BOX1 rotate<0,-180,0>} object{BOX1 rotate<0,-240,0>} object{BOX2} object{BOX2 rotate<0,+60,0>} object{BOX2 rotate<0,-60,0>} translate<0,0,VA> } // SUPPORTS // #declare SUPPORT = box{<-.3,-4,-1.5>, <+.3,-1.01,+1.5> translate<0,0,UA>} #declare SUPPORT = cylinder{<0,-4,0>, <0,-1.01,0> 2 scale<1/4,1,1> translate<0,0,UA>} #declare SUPPORTS = union{ object{SUPPORT rotate<0,30,0>} object{SUPPORT rotate<0,-30,0>} object{SUPPORT rotate<0,90,0>} object{SUPPORT rotate<0,-90,0>} translate<0,0,VA> } // COMPLETE union{ union{ object{ROOMS} object{ROOMS rotate<0,120,0> } object{ROOMS rotate<0,240,0> } texture{SC0O} scale } union{ object{SUPPORTS} object{SUPPORTS rotate<0,120,0>} object{SUPPORTS rotate<0,240,0>} texture{glas} } merge{ object{FLOORS} object{FLOORS rotate<0,120,0>} object{FLOORS rotate<0,240,0>} texture{ft} } // clipped_by{cylinder{<0,-4,0>, <0,0,0>, 100}} rotate<0,10,0> translate<0,0,-0.875> }