/* POVRAY PROGRAM TO CREATE THE TORUS SHELL WITH AN ADVANCED PENTAGONAL FORM OF INTERNAL DIVISION [CODE NAMED: ARTHUR'S PILES] OF THE UNIVERSAL TERRESTRIAL DWELLING By: ROBERT JOHN MORTON YE572246C THIS TAKES THE FORM OF LINKED ELLIPSOIDS WITHIN A TORROIDAL TUBE FRAME COMMAND LINE: povray -visual DirectColor lardocecu2.pov +W640 +H480 */ #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 /* CAMERA ----------------------------------------------------------------------------------------- VIEW LOCATION LOOK-AT ANGLE ROTATE TRANSLATE FILENAME Horizontal 0, 4, 350 0, 0, 0 13 0,-103,0 6,0,0 hor_med Near Angled 0,130,260 0, 0, 0 13 0,-103,0 6,0,-10 near_ang_med Far Angled 0,350,700 0,0,0 13 0,-103,0 6,0,10 far_ang_med Close Plan 0,225,20 0, 0, -1.5 13 0,-103,0 0,,1.5 Medium Plan 0,480,30 0, 0, 0 13 0,-103,0 0,0,3 plan_med Gleba Plan 0,1100,20 -6, 0, -4 13 0,-103,0 0,0,0 trigleb Floor Plan 0,402,5 0,0,0 13 1280x960 Floor Plan 0,201,5 0,0,0 13 1280x960 View20-320 Picture sizes: small = 320 by 240, med = 640 by 480, big = 1280 by 960 Large-scale floor plan = 3.637681159 x small-scale floor plan x=0, y=110.509960159, z=5 To make the movie, fly the camera around a circle 70 metres radius that passes through the centre of the ninho. The camera rises sinusoidally as it recedes from the centre of the ninho. HORIZON CALCULATION */ #declare oh = 17.3; //observer's eye height above the gound #declare rd = 500; //hiponenuse distance from observer to ninho #declare oz = sqrt(rd * rd - oh * oh); //horizontal distance observer is in front of co-ordinate origin #declare HZ = -(sqrt(oh*(12756280 + oh)) - oz); //horizon distance from observer camera{ location <0, oh - 4, oz> look_at <0, -4, HZ> angle 13 } /* camera{ location <0, 300,5> 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 10000 // 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 #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 10000 // 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 */ object { sun_white rotate <-80,0,-30> } object { sun_yellow rotate <-80,0,-30> } // 2) simulate light from the horizon #declare luz = light_source { <0, -1.6, 500> color rgb <.2, .3, .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 // BACKGROUND ------------------------------------------------------------------------------------- /* SPECIAL TEXTURES USED IN THIS PROJECT ---------------------------------------------------------- Shell Deep Magenta 0.53, 0.40, 0.80 Shell Light Magenta 0.53, 0.47, 0.80 (magentaish grey) Shell Light Green 0.53, 0.80, 0.47 (yellowish grey) Shell Light Pink 0.80, 0.53, 0.47 Shell Light Brown 0.80, 0.47, 0.53 */ #declare Shell_Colour = texture { pigment { color rgbt <0.50, 0.52, 0.49, 0.15> } // grey with a suggestion of light green finish { phong 0.8 ambient 0.6 } } #declare Shell_Snow = texture { pigment { color rgb <.6, .65, .7> } // grey with a suggestion of light green finish { phong 0.8 ambient 0.6 } } #declare Inner_Colour = texture { pigment { color rgbt <0.50, 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 } } #declare Land_Colour = texture { // define its ground texture that comprises: pigment { color rgb <0.85, 1.0, 0.6> } finish { diffuse 0.2 ambient 0.5 } } #declare Ninho_Colour = texture { // define its ground texture that comprises: pigment { color rgb <0.00, 0.85, 1.0, 0.6> } finish { diffuse 0.2 ambient 0.5 } } //LANDSCAPE AND SKY ------------------------------------------------------------------------------- #declare rp = 6378140; //Earth radius #declare mountain = cone{<0, rp+50, 0>, 40 <0, rp, 0>, 100} merge{ sphere{<0,0,0>, rp} //create spherical planet object{mountain rotate<-.005,-20,0>} object{mountain rotate<-.005,+20,0>} object{mountain rotate<-.010,-10,0>} object{mountain rotate<-.010,+10,0>} object{mountain rotate<-.015,-05,0>} object{mountain rotate<-.015,+05,0>} object{mountain rotate<-.020,-01,0>} translate<0,-(rp+4),0> //translate it downwards so ground level is -4 metres texture{Land_Colour} } 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 } } // OBJECTS -------------------- Dimensions in Metres ---------------------------------------------- #declare ground_level = -4; // depth of the ground below the co-ordinate origin // 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 // ROOMS -------------------------------------------------------------------- #declare G = 1.6180339887; //golden ratio #declare g = 1/G; #declare A = 72; //one fifth of a turn #declare sr = 3.0; #declare mr = 4.512683221310053; #declare lr = 5.353873392878017; #declare R1 = 20.16929556748853; /* #declare sr = 2.5; //radius of small circle #declare mr = 3.7605693510917115; //radius of medium circle #declare lr = 4.461561160731682; //radius of large circle #declare R1 = 16.807746306240446; //radius of the outer containing circle */ #declare R = lr/sind(36); //radius from centre of ninho to centre of large room #declare R2 = R - lr; //radius of the inner containing circle 7.590461216 #declare Rm = (R1 - R2) / 2; //minor radius of the torus 4.608642545 #declare RM = R2 + Rm; //major radius of the torus 12.199103761 #declare dr = 0.5; //amount by which radius of each room is reduced to make space for torus curvature /* #declare sf = cylinder{<0,-1,0>,<0,4,0>,sr-dr translate<0,0,sr+lr>} //small floor #declare mf = cylinder{<0,-1,0>,<0,4,0>,mr-dr translate<0,0,R+lr+1>} //medium floor #declare lf = cylinder{<0,-1,0>,<0,4,0>,lr-dr} //large floor */ #declare sf = sphere{<0,0,0>,sr-dr scale<1,g,1> translate<0,0,sr+lr>} //small floor #declare mf = sphere{<0,0,0>,mr-dr scale<1,g,1> translate<0,0,R+lr+1>} //medium floor #declare lf = sphere{<0,0,0>,lr-dr scale<1,g,1>} //large floor #declare piles = union{ object{lf} object{sf rotate<0, 21,0>} object{sf rotate<0,-21,0>} translate<0,0,R> } #declare Piles = union{ #declare a = 0; #while(a < 360) object{piles rotate<0,a,0>} object{mf rotate<0,a+A/2,0>} #declare a = a + A; #end } // SEGMENT WINDOWS #declare swinseg = difference{ //segment windows for small room difference{ difference{ //window anulus cylinder{<0,1,0>,<0,5,0>, sr - 1} //outer skylight cylinder - small room cylinder{<0,.999,0>,<0,5.01,0>, (sr - 1)/G} //inner skylight cylinder - small room } box{<-sr,.998,-sr>,<0,5.02,sr>} rotate<0,180-A/2,0> } box{<-sr,.998,-sr>,<0,5.02,sr>} } #declare sS = union{ #declare a = 0; #while(a < 360) object{swinseg rotate<0,a,0>} #declare a = a + A; #end cylinder{<0,1,0>, <0,5,0>, (sr-1)/3} translate<0,0,sr+lr> //move to radial position relative to large room } #declare mwinseg = difference{ //segment windows for medium room difference{ difference{ //window anulus cylinder{<0,1,0>,<0,5,0>, mr - 1} //outer skylight cylinder - small room cylinder{<0,.999,0>,<0,5.01,0>, (mr - 1)/G} //inner skylight cylinder - small room } box{<-mr,.998,-mr>,<0,5.02,mr>} rotate<0,180-A/2,0> } box{<-mr,.998,-mr>,<0,5.02,mr>} } #declare mS = union{ #declare a = 0; #while(a < 360) object{mwinseg rotate<0,a,0>} #declare a = a + A; #end cylinder{<0,1,0>, <0,5,0>, (mr-1)/3} translate<0,0,R+lr+1> } #declare lwinseg = difference{ //segment windows for large room difference{ difference{ //window anulus cylinder{<0,1,0>,<0,5,0>, lr - 1} //outer skylight cylinder - small room cylinder{<0,.999,0>,<0,5.01,0>, (lr - 1)/G} //inner skylight cylinder - small room } box{<-lr,.998,-lr>,<0,5.02,lr>} rotate<0,180-A/2,0> } box{<-lr,.998,-lr>,<0,5.02,lr>} } #declare lS = union{ #declare a = 0; #while(a < 360) object{lwinseg rotate<0,a,0>} #declare a = a + A; #end cylinder{<0,1,0>, <0,5,0>, (lr-1)/3} } #declare SW1 = union{ object{lS} object{sS rotate<0, 21,0>} object{sS rotate<0,-21,0>} translate<0,0,R> } #declare windows = union{ #declare a = 0; #while(a < 360) object{SW1 rotate<0,a,0>} object{mS rotate<0,a+A/2,0>} #declare a = a + A; #end } // TORUS SHELL #declare h1 = 2.5; //height clearance under the ninho #declare S = h1 * G / Rm; //vertical scaling factor #declare rail = torus{ Rm+dr, 0.25 rotate<0,0,90> translate<0,0,RM> rotate<0,36-13.750776406,0> scale<1,1/2.718281828,1> } #declare L = 6.6; #declare bar = cylinder{ <0,0,-L>, <0,0,+L>, 0.25 translate<0,0,RM> rotate<0,36-13.750776406,0> scale<1,1/2.718281828,1> translate<0,-2,0> } #declare low_bar = union{ torus{RM+L, 0.25} torus{RM-L, 0.25} scale<1,1/2.718281828,1> clipped_by{box{<-50,-4,-50>, <0,5,50>}} rotate<0,152.498447189,0> clipped_by{box{<-50,-4,-50>, <0,5,50>}} rotate<0,-22.249223595,0> } #declare bars = union{ object{bar} object{low_bar translate<0,-2,0>} } #declare frame = union{ union{ #declare i = 0; #while(i < 360) object{rail rotate<0,i,0>} object{rail rotate<0,i+27.501552811,0>} #declare i = i + 72; #end clipped_by{cylinder{<0,-2 - .25/2.718281828,0>, <0,5,0>, RM+Rm+dr+1}} } union{ #declare i = 0; #while(i < 360) object{bars rotate<0,i,0>} object{bar rotate<0,i+27.501552811,0>} #declare i = i + 72; #end torus{RM, 0.25 scale<1,1/2.718281828,1> translate<0,(Rm+dr)/2.718281828,0>} torus{RM+Rm+dr, 0.25 scale<1,1/2.718281828,1>} torus{RM-Rm+dr, 0.25 scale<1,1/2.718281828,1>} torus{RM+L, 0.25 scale<1,1/2.718281828,1> translate<0,2,0>} torus{RM-L, 0.25 scale<1,1/2.718281828,1> translate<0,2,0>} } } // 27.501552811 -44.498447189 152.498447189 #declare leg = union{ box{<-2,0,-.15>, <+2,5,+.15> rotate<60,0,0> translate<0,-4,0>} box{<-2,-4,-.1>, <-1.8,-1.5,+.1>} box{<+2,-4,-.1>, <+1.8,-1.5,+.1>} translate<0,0,RM> } #declare legs = union{ #declare a = 0; #while(a < 360) object{leg rotate<0,a+A/2,0>} #declare a = a + A; #end } // ROADS ------------------------------------------------------------------------------------------ #declare road = box{<-1,-4,2>,<+1,-3.99,fr>} //one road #declare roads = union{ //5 roads arranged radially #declare a = 0; #while(a < 360) object{road rotate<0,a,0>} #declare a = a + A; #end texture{ROAD} } // object{ownership} // transparent ellipsoid showing extent of "ownership" space // object{crater} object{gleba} // circular area with radial colour gradient #declare PILES = difference{ object{Piles clipped_by{cylinder{<0,5,0>, <0,-1.5,0>, 30}}} cylinder{<0,-1.51,0><0,-1.505,0>, 20} } // CREATE THE COMPLETE LANDSHARE ------------------------------------------------------------------ union { object{roads} object{PILES texture{Shell_Colour}} object{frame texture{Inner_Colour}} // object{floors clipped_by{torus{RM, Rm scale<1,S,1>}} texture{Inner_Colour}} // object{TT texture{Shell_Colour}} // object{shell clipped_by{object{windows}} texture{GLASS}} //window panels object{legs texture{Shell_Colour}} // clipped_by{box{<-100,-4,-100>,<100,0,100>}} //to create floor-plan view // clipped_by{box{<0,-4,-100>,<100,4,100>}} //to create elevation view // rotate<-90,0,0> rotate<0,3,0> // translate<0,0,-15> //to create a good angled view // translate }