/* POVRAY PROGRAM TO CREATE THE BULGING CYLINDER SHELL VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING By ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor inflatable.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" #include "glass.inc" global_settings{max_trace_level 256} //max possible is 256 #declare G = 1.6180339887; //golden ratio // 1) CAMERA ------------------------------------------------------------------ // 1.png 2.png 3.png 4.png 5.png 6.png #declare Height = 75; // 100 16 2 223 223 100 #declare Dist = 180; // 223 223 223 5 5 223 camera{location<0, Height, Dist> look_at <0, 0, 0> angle 13} // 2) LIGHTING ---------------------------------------------------------------- #declare camera_lights = light_source { //CAMERA LIGHT <0, Height, Dist> //located at camera color rgb <.4,.4,.4> //white cylinder //cylindrical beam radius 100 //radius 100 units at full intensity falloff 10000 //falling off to zero at 70 units area_light <1,0,0>, <0,0,1>, 20,20 //lighting element: 20 x 20 pixel array adaptive 1 //normal is determined by the vectors jitter //minimise number of test rays required point_at <0, 0, 0> //light beam aimed at coordinate origin } //jitter softens shadows object{camera_lights} #declare sun = light_source { //SUN LIGHT <0, 1000, 0> //located overhead color rgb <.8,.7,.6> //reddish light cylinder //confined to a cylindrical beam radius 80 //of radius 80 units at full intensity falloff 10000 //falling off to zero at 10000 units area_light <1,0,0>, <0,0,1>, 20,20 //lighting element 20 x 20 pixel array adaptive 1 //normal is determined by the vectors jitter //minimise no. of test rays required point_at <0, 0, 0> //light beam aimed at coordinate origin } //jitter softens shadows object{sun rotate <-5, 0, -10>} // Horizon Glow 1.png 2.png 3.png 4.png 5.png 6.png #declare h = 0; // 0 0 0 20 20 0 #declare b = .1; // .1 .1 .1 .2 .2 .1 #declare horizon_light = light_source{<100,h,0> color rgb } #declare horizon_glow = union{ #declare a = 20; #while(a < 360) object{horizon_light rotate<0,a,0>} #declare a = a + 60; #end } //object{horizon_glow} // 3) SPECIAL TEXTURES USED IN THIS PROJECT ----------------------------------- #declare Shell_ColourR = texture { pigment { color rgb <0.7, 0.9, 0.7>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare Shell_ColourB = texture { pigment { color rgb <0.5, 0.5, 1>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare Shell_Colour1 = texture { pigment { color rgb <0.60, 0.56, 0.52>} //, 0.15> } // greeny-red finish { phong 0.8 ambient 0.6 } } #declare Shell_Colour2 = texture { pigment { color rgb <0.52, 0.60, 0.56>} //, 0.15> } // bluey-green finish { phong 0.8 ambient 0.6 } } #declare Shell_Colour3 = texture { pigment { color rgb <0.52, 0.56, 0.60>} //, 0.15> } // greeny-blue finish { phong 0.8 ambient 0.6 } } #declare ROAD = texture { pigment { colour rgb <0.52, 0.49, 0.50> } // light grey tarmac. finish { phong 0.8 ambient 0.4 } } #declare GLASS = texture{pigment{color Col_Glass_General}} // 4) ENVIRONMENT ------------------------------------------------------------- #declare ground_level = -4; //amount ground is below co-ordinate origin #declare fr = 79.788456088; //radius of a 2-hectare gleba (in metres) #declare md = -7000; //mountains are 5km away #declare rp = 6378140; //Earth radius #declare mountain = cone{<0, rp+40, 0>, 40 <0, rp, 0>, 100} 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<0,ground_level - rp,0> //translate it downwards to ground level } 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 } } // 5) GLEBA CIRCLE ------------------------------------------------------------ #declare gleba_height = .002; //gleba is 5 mm above ground level #declare gleb = 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 } #declare gleba = object{gleb scale} //rescale size to 2-hectare gleba #declare mgr = sqrt(20000/(3*3.141592653)); //mini-gleba radius #declare glebshift = mgr * (1/cosd(30)-1); #declare minigleb = object { gleb scale clipped_by { cylinder { <0, -5, mgr>, <0, -3, mgr>, mgr } } translate <0, 0, glebshift> } #declare trigleb = union { #declare k = 30; #while (k < 390) object { minigleb rotate <0, k, 0> } #declare k = k + 120; #end } #declare ownership = sphere{<0,-4,0>, fr scale<1,1.5,1> texture{GLASS}} // 6) CREATE THE BASIC SHELL -------------------------------------------- #declare leg_length = 2; #declare Leg = cylinder{<2,-1 - leg_length,0>, <2,-1,0>, 0.15} #declare Rat = 3.06475; //ratio required to achieve merge between caps and belt #declare shell = sphere{<0,0,0>, 2 scale} //ellipsoid #declare RR = 8.5; // 8.660254038; /* It follows that RR is also the separation distance between the centres of every adjacent pair of ellipsoidal shell units of the ninho. RR is thus the diameter D of the circular flat floor i.e. the bottom of the inner surface of a shell unit. Hence: */ #declare D = RR/2; //4.33012702; /* It follows that D is the radius of the circle on which the centres of the inner ring of shell units rest. The radius of the outer d circle on which the centres of the outer-most shell units lie is RR / tan(30) = 15 metres. Hence: */ #declare d = RR / tand(30); // 13.85640646; //15; #declare belt = torus{4, 0.75 scale<1,2,1>} #declare belt_pair = merge{ object{belt translate<0,0,RR>} object{belt rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} } #declare belt_quad = merge{ //functional group of 4 shell units object{belt_pair} object{belt_pair rotate<0,60,0>} } #declare belts = merge{ //put the 3 groups of 4 together to form ninho object{belt_quad texture{Shell_Colour1}} object{belt_quad rotate<0,120,0> texture{Shell_Colour2}} object{belt_quad rotate<0,240,0> texture{Shell_Colour3}} } #declare cutter = cylinder{<0,-4.01,0>, <0,4.01,0>, 3.96} #declare cutter_pair = union{ object{cutter translate<0,0,RR>} object{cutter rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} } #declare cutter_quad = union{ //functional group of 4 shell units object{cutter_pair} object{cutter_pair rotate<0,60,0>} } #declare cutters = union{ //put the 3 groups of 4 together to form ninho object{cutter_quad} object{cutter_quad rotate<0,120,0>} object{cutter_quad rotate<0,240,0>} } #declare Cutter = difference{cylinder{<0,-4,0>, <0,4,0>, 20} object{cutters}} #declare Belts = object{belts clipped_by{object{Cutter}}} #declare botcap = object{shell clipped_by{cylinder{<0,0,0>, <0,-4,0>, 4.04}}} #declare botcap_pair = union{ object{botcap translate<0,0,RR>} object{botcap rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} } #declare botcap_quad = union{ //functional group of 4 shell units object{botcap_pair} object{botcap_pair rotate<0,60,0>} } #declare botcaps = union{ //put the 3 groups of 4 together to form ninho object{botcap_quad texture{Shell_Colour1}} object{botcap_quad rotate<0,120,0> texture{Shell_Colour2}} object{botcap_quad rotate<0,240,0> texture{Shell_Colour3}} } #declare platform = union{ cylinder{<0,-1.5,0>,<0,-1.1,0>,4} //floor cylinder{<0,ground_level,0>,<0,-1.51,0>,1} //leg } #declare platform_pair = union{ object{platform translate<0,0,RR>} object{platform rotate<0,90,0> translate<0,0,d> rotate<0,30,0>} } #declare platform_quad = union{ //functional group of 4 shell units object{platform_pair} object{platform_pair rotate<0,60,0>} } #declare platforms = union{ //put the 3 groups of 4 together to form ninho object{platform_quad texture{Shell_Colour1}} object{platform_quad rotate<0,120,0> texture{Shell_Colour2}} object{platform_quad rotate<0,240,0> texture{Shell_Colour3}} } // STANDARD DOORWAY ----------------------------------------------------- #declare doorway = box{<-1.5,-1.1,-0.025>,<+1.5,+1.1,+0.025> translate} #declare doorways = merge{ #declare a = 0; #while(a < 360) object{doorway rotate<0,a,0>} #declare a = a + 60; #end texture{Shell_ColourB} } // 14) ROAD ------------------------------------------------------------------- #declare road_height = -1.47; #declare road = box{ <-1, road_height, RR * 1.5>, <+1, road_height - 0.02, fr> texture{ROAD} } // 15) DISPLAY THE COMPLETE LANDSHARE ----------------------------------------- union { // object{crater} //set the gleba inside a shallow crater object{gleba} //circular area with radial colour gradient object{road rotate<0,+60,0>} object{road} object{road rotate<0,-60,0>} union{ object{botcaps} //roof and skylight units object{Belts} object{platforms} object{doorways} // clipped_by{cylinder{<0,ground_level,0>, <0,0,0>, 100}} //to create open floor plan // clipped_by{box{<-50,-4,-50>, <50,4,0>}} //vertical slice view // translate } // object{ownership} //transparent ellipsoid showing extent of ownership space rotate<0,7,0> //give it a slight twist to make it look cute // translate<0,0,-D> } // Programmer: Robert John Morton