/* POVRAY PROGRAM TO CREATE THE TORROIDAL RINGS VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING By ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor rings.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 "metals.inc" #include "stones.inc" #include "glass.inc" global_settings{max_trace_level 256} // max possible is 256 #declare vr = 300; // viewing radius #declare va = 30; // viewing angle camera{location<0,vr * sind(va),vr * cosd(va)> look_at<0,0,0> angle 13} #declare fr = 79.788456088; // radius of a 2-hectare gleba (in metres) // LIGHTING --------------------------------------------------------------------------------------- // 1) Simulate the sun #declare sun_white = light_source { // WHITE SUN IS ON THE HORIZON DUE SOUTH <0, 0, 1000> // located at south horizon color rgb <.4,.5,.3> // white light cylinder // confined to a cylindrical beam radius fr // of radius 100 units diameter at full intensity falloff 4000 // falling off to zero brightness at 1000 units diameter area_light <1,0,0>, <0,0,1>, 20,20 // lighting element is a 20 x 20 array of 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> // the light beam is aimed at the co-ordinate origin } // jitter softens shadows #declare sun_yellow = light_source { //YELLOW SUN IS ON THE HORIZON DUE SOUTH <0, 0, 1000> // located at south horizon color rgb <.8,.7,.6> // yellow light cylinder // confined to a cylindrical beam radius fr // of radius 100 units diameter at full intensity falloff 4000 // falling off to zero brightness at 70 units diameter area_light <1,0,0>, <0,0,1>, 20,20 // lighting element is a 20 x 20 array of 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> // the light beam is aimed at the co-ordinate origin } // jitter softens shadows /* rotate the sun to its desired elevation eg -60 means the sun is 60 degrees above the horizon due south. Rotate it round the z-axis to simulate time of day eg -15 means 15 degrees (one hour) before noon. Sun: ascention 80 degrees, declination 30 degrees */ union { object { sun_white } object { sun_yellow } rotate <-80,0,-30> } // 2) simulate light from the horizon #declare luz = light_source { <0, -1.6, 500> color rgb <.15, .25, .3> } // horizon light #declare horizonglow = union { #declare iii = 0; #while(iii < 360) object { luz rotate <0,iii,0> } #declare iii=iii + 51.428571429; #end } object{horizonglow rotate <0,0,0>} // rotate the 7 horizon lights to best position // 4) RING OF LIGHTS AROUND THE BOTTOM OF THE LIFT-SHAFT TO LIGHT THE STAIRS FROM BENEATH #declare lower_light = light_source { <0, -3.95, 1.5> color rgb <.15, .15, .1> } #declare lower_stair_lights = union { object { lower_light } object { lower_light rotate <0, 72,0> } object { lower_light rotate <0,144,0> } object { lower_light rotate <0,216,0> } object { lower_light rotate <0,288,0> } } // BACKGROUND ------------------------------------------------------------------------------------- #declare md = -7000; //mountains are 5km away #declare rp = 6378140; //Earth radius #declare ground_level = -2; //depth of ground below co-ordinate origin 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,-(rp-ground_level),0> //translate it downwards so ground level is -4 metres } 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 } } // SPECIAL TEXTURES USED IN THIS PROJECT -------------------------------------------------------- #declare Colour = texture { pigment { color rgb <0.50, 0.52, 0.49> } // grey with a suggestion of light green finish { phong 0.8 ambient 0.6 } } #declare Colour2 = texture { pigment { color rgb <0.50, 0.52, 0.49, 0.65> } // grey with a suggestion of light green finish { phong 0.8 ambient 0.6 } } #declare Colour3 = texture { pigment { color rgb <0.55, 0.52, 0.49> } // grey with a suggestion of light green finish { phong 0.8 ambient 0.6 } } #declare Inner_Colour = texture { pigment { color rgb <0.57, 0.55, 0.53> } // grey with a hint of red finish { phong 0.8 ambient 0.9 } } #declare YELLOW = texture { pigment { color rgb <0.82, 0.78, 0.29> } // crop corn colour finish { phong 0.8 ambient 0.4 } } #declare CYAN = texture { pigment { color rgb <0.58, 0.55, 0.30> } // crop ploughed colour finish { phong 0.8 ambient 0.4 } } #declare ROAD = texture { pigment { colour rgb <0.52, 0.49, 0.50> } // light grey tarmac. finish { phong 0.8 ambient 0.4 } } #declare LAKE = texture { pigment { color rgb <0.46, 0.54, 0.97> } // water blue finish { diffuse 0.3 ambient 0.3 phong .95 } } #declare GLASS = texture{pigment{color Col_Glass_General}} #declare GLASS1 = texture { pigment { color Col_Glass_General } finish { F_Glass8 } } #declare GLASS2 = texture { pigment { color Col_Glass_Green } finish { F_Glass8 } } // OBJECTS -------------------- Dimensions in Metres ---------------------------------------------- // 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 rgb <0.8, 1.0, 0.5> } } finish { // with surface characteristics: diffuse 0.2 // diffusion ambient 0.5 // effective ambient lighting (brightness) } } translate <0,ground_level,0> // move the gradiented circle down to ground level } #declare gleba = object{gleb scale} // rescale to the size of the 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}} //ownership sphere // ROADS ------------------------------------------------------------------------------------------ #declare road = box{<-1,-1,2>,<+1,-0.99,fr>} //one road #declare roads = union{ //6 roads arranged radially #declare a = 30; #while(a < 360) object{road rotate<0,a,0>} #declare a = a + 120; #end texture{ROAD} } // MAIN TORUS SHELL ---------------------------------------- /* #declare G = 1.6180339887; //golden ratio #declare q = (r + H) / G; //radius to inner rim of body = 3.70820393 metres */ #declare h = 2; //vertical radius of torus body #declare H = h/2; //horizontal radius of inner torus = 1 metre #declare r = 4; //width of torus body in metres (minor radius) #declare q = r + H; //radius to inner rim of body = 5 #declare R = q + H; //major radius = 6 #declare RR = R + r; //total radius of ring unit = 10 metres #declare bigR = RR + q; //see BigR calculation.txt #declare tor1 = union{ difference{ torus{ R, r scale<1,h/r,1> } cylinder{<0,-3,0>, <0,3,0>, R } texture{Colour3} } torus{ R, H scale<1,h/H,1> clipped_by{cylinder{<0,-3,0>, <0,3,0>, R }} texture{Colour}} } #declare tor2 = union{ difference{ torus{ R, r scale<1,h/r,1> } cylinder{<0,-3,0>, <0,3,0>, R } texture{Colour} } torus{ R, H scale<1,h/H,1> clipped_by{cylinder{<0,-3,0>, <0,3,0>, R }} texture{Colour3}} } #declare T1 = object{tor1 translate<0,0,bigR>} //for inner surface of shell #declare T2 = object{tor2 translate<0,0,bigR>} //for inner surface of shell #declare TG = merge{ #declare a = 0; #while(a < 360) object{T1 rotate<0,a,0>} object{T2 rotate<0,a+60,0>} #declare a = a + 120; #end } #declare C = cylinder{<0,-1.1,0>, <0,-1,0>, q translate<0,0,bigR>} #declare CG = union{ #declare a = 60; #while(a < 360) object{C rotate<0,a,0>} #declare a = a + 120; #end texture{Colour2} } #declare S = merge{ sphere{<0,0,0>, RR scale<1,h/RR,1>} translate<0,0,bigR> texture{Colour} } #declare SG = union{ #declare a = 0; #while(a < 360) object{S rotate<0,a,0>} #declare a = a + 120; #end texture{Colour2} } #declare N = merge{ object{SG} object{TG} object{CG} } // CREATE THE COMPLETE LANDSHARE ------------------------------------------------------------------ #declare landshare = union { // object{ownership} // transparent ellipsoid showing extent of "ownership" space object{gleba} // circular area with radial colour gradient // object{roads} // object{plinths} object{N} // the buildings } object{landshare // clipped_by{box{<-100,-4,-100>,<100,-.8,100>}} //to create floor-plan view rotate<0,-23,0> // translate<0,0,-10> //to create a good angled view } /* END OF PROGRAM NOTES --------------------------------------------------------------------------------- F = 3.46410162 F2 = 12 R = 4 R2 = 16 R2 - F2 = 16 - 12 = 4 ------------------ A = 4 H = 2 H2 = 4 13.85640648 2FH2 = -27.71281296 ------------- B = -27.71281296 R2 = 16 Y2 = 2.25 R2*Y2 = 36 H4 = 16 36 - 16 = 20 ------------------ C = 20 B2 - 4AC = 768.00000216-320 = 448.00000216 Sqrt = 21.16601054 2A = 8 27.71281296+21.16601054 = 48.8788235 == 6.10985294 = a 27.71281296-21.16601054 = 6.54680242 == 0.8183503 = b 6.92820324 checksum D = F - b = 3.46410162-0.8183503 = 2.64575132 */