/* POVRAY PROGRAM TO CREATE THE 5-PETAL TORUS SHELL WITH A PENTAGONAL FORM OF INTERNAL DIVISION OF THE UNIVERSAL TERRESTRIAL DWELLING By: ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor torus-flower.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. Note: my eye height is -2.27 metres from the zero level 4 metres above the ground. */ camera { location <0,402,5> look_at <0, 0, 0> angle 13 } // LIGHTING --------------------------------------------------------------------------------------- // light_source { <15, 200, 30> color rgb <1, 1, 1> } // for quick tests // light_source { <7.25, 1.1, 8> color rgb <1, 1, 1> } // for quick tests // 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 100 // of radius 100 units diameter at full intensity falloff 200 // 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 100 // of radius 100 units diameter at full intensity falloff 200 // 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 // BACKGROUND ------------------------------------------------------------------------------------- plane { y, -4 // CREATE A GROUND PLANE texture { // define its texture that comprises: pigment { color rgb <0.85, 1.0, 0.6> } finish { diffuse 0.2 ambient 0.5 } } } 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 ---------------------------------------------------------- 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 rgb <0.50, 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 ---------------------------------------------- #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 fr = 79.788456088; // radius of a 2-hectare gleba (in metres) #declare crater = torus{ fr, 5.0 scale<1,2,1> texture { // define its texture that comprises: pigment { color rgb <0.85, 1.0, 0.6> } finish { diffuse 0.2 ambient 0.5 } } } #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 // TORUS VERSION: BASIC FLOORS -------------------------------------------------------------------- #declare G = 1.6180339887; //golden ratio #declare s = 1 / (G * G); //vertical scale for corridor 0.381966011 #declare S = s / G; //vertical scaling to give torus correct external half-height //of 0.236067977 #declare R2 = 2.5; //radius of smaller circular floor #declare R1 = R2 * G; //radius of larger circular floor (4.045084972) #declare D1 = 2 * R1; //8.090169943 #declare D2 = 2 * R2; //5 #declare k = G + 1; //clearance between cylinders and outer skin of torus 2.6180339887 #declare p = R1 * (1 + sqrt(3)) + k; // 13.669411653 #declare q = 2 * G + 1; // 4.236067977 #declare r = R2 + k; // 5.118033989 #declare a = q * q - 1; // 16.944271906 #declare b = -2 * (p + q * r); // -70.699503078 #declare c = r * r - R1 * R1 - p * p; //-177.021255457 #declare O = (sqrt(b * b - 4 * a * c) - b) / (2 * a); //minimum radius 5.35690306 #declare R = (1 + 2 * G) * O - R2 - k; //major radius at centres of small rooms #declare Z = 2 * (G * O - k) - R2 - R1; #declare T1 = O * G; //semi ring-width (Torus's outer minor radius) 8.667651225 #declare T2 = O + T1; //Torus's major radius 14.024554285 #declare H = O + k + R1; //radial shift that must be applied to the floors 12.020022021 #declare Rring = H + R1; //outer radius of the ring floor 16.065106993 #declare N = 5; //number of "petal" units #declare A = 360 / N; //resulting angle occupied by each petal #declare B = A / 2; //half the above angle (used a lot later) #declare o = -1.5; //height of the bottom of the outer surface of the shell #declare Q = -1.001; //height of the floor of the inner surface of the shell #declare q = -.001; //thickness of the shell surface skin #declare f = -0.999; //floor height of rooms /* Total radius of torus = 22.69220551 metres So, area occupied by torus = 1617.719754121 square metres = 0.161771975 hectare. The physical area of the torus ring = 1617.719754121 - 90.152432062 = 1527.567322059 square metres. Half-height of the outer surface = 2.046154893 metres. Half-height of the inner surface = 1.664188882 metres. Available flat floor width in corridor segment = .664188882 * 2 * G = 2.149360372 metres */ #declare clip_hi = cylinder{<0, 0,0>,<0,4,0>,T2+T1} //just take the upper half of the torus #declare clip_lo = cylinder{<0,-4,0>,<0,0,0>,T2+T1} //just take the lower half of the torus #declare clip_vt = box{<0,-4,-30>,<30,+4,+30>} //clip segment of torus vertically // INNER SHELL ------------------------------------------------------------------------------------ #declare EI = sphere{ //inner surface of ellipsoidal end cap <0,0,0>,T1-1 scale clipped_by{box{<0,-4,-30>,<+30,+4,+30>}} } #declare TI = torus{ T2, T1-1 scale<1,S,1> clipped_by{object{clip_vt}} rotate<0,180-B,0> clipped_by{object{clip_vt}} rotate<0,B,0> } #declare CI = torus{ //small torus corridor segment: vertical radius = 1.028525294 metres T2, O-1 scale<1,s,1> clipped_by{object{clip_vt}} rotate<0,180-B,0> clipped_by{object{clip_vt}} } #declare innerShell = merge{ //complete segment comprising: object{EI rotate<0,180,0> translate<0,0,-T2> rotate<0,B,0>} //right-hand end-cap object{TI} //large torus segment for petal object{EI translate<0,0,-T2>} //left-hand end-cap object{CI} //small torus segment for corridor } #declare innerSHELL = merge{ //rotate and merge 5 segments to make a full ring #declare a = -B/2; #while(a < (360-B/2)) object{innerShell rotate<0,a,0>} #declare a = a + A; #end } // OUTER SHELL ------------------------------------------------------------------------------------ #declare EO = sphere{ //inner surface of ellipsoidal end cap <0,0,0>,T1 scale clipped_by{box{<0,-4,-30>,<+30,+4,+30>}} } #declare TO = torus{ //large torus petal segment T2, T1 scale<1,S,1> clipped_by{object{clip_vt}} rotate<0,180-B,0> clipped_by{object{clip_vt}} rotate<0,B,0> } #declare CO = torus{ //small torus corridor segment: vertical radius = 1.028525294 metres T2, O scale<1,s,1> clipped_by{object{clip_vt}} rotate<0,180-B,0> clipped_by{object{clip_vt}} } #declare outerShell = merge{ //complete segment comprising: object{EO rotate<0,180,0> translate<0,0,-T2> rotate<0,B,0>} //right-hand end-cap object{TO} //large torus segment for petal object{EO translate<0,0,-T2>} //left-hand end-cap object{CO} //small torus segment for corridor } #declare outerSHELL = merge{ #declare a = -B/2; #while(a < (360-B/2)) object{outerShell rotate<0,a,0>} #declare a = a + A; #end } //FLOORS ------------------------------------------------------------------------------------------ #declare CL = light_source{<0, 0, Rring-1> color rgb <.3, .3, .2>} //mid-corridor light #declare lights = union{ #declare a = 0; #while(a < 360) object{CL rotate<0,a,0>} #declare a = a + A; #end } #declare ringFloor = difference { union{ cylinder{ <0,f,0>, <0,4,0>, Rring } cylinder{ <0,f,0>, <0,4,0>, Rring-2 } } cylinder{ <0,-1.01,0>, <0,3.01,0>, Rring - 2.01 pigment{color rgbt<1,1,1,1>} } } #declare rectFloor = merge{ //peripheral rectangular room box{<-R2/2,f,-Z-R2>,<+R2/2,4,-Z+R2>} //room box{<-.75,f+.001,0>,<+.75,1,2> translate<0,0,-R1-1.75>} //doorway corridor } #declare smallFloor = merge{ cylinder{<0,f,-D1>, <0,4,-D1>, R2} //cylindrical ante-room box{<-.75,f+.01,0>,<+.75,1,2> translate<0,0,-R1-1.75>} //doorway corridor } #declare largeFloor = cylinder{ <0,f,0>, <0,4,0>, R1 } //cylindrical main-room #declare floors = merge { object{largeFloor} object{smallFloor rotate<0,+30,0> } object{smallFloor rotate<0,-30,0> } object{rectFloor} translate<0,0,-H> } #declare FLOORS = merge{ union{ #declare a = 0; #while(a < 360) object{floors rotate<0,a,0>} #declare a = a + A; #end } object{ringFloor} // object{lights} } // SUPPORT PLINTHS -------------------------------------------------------------------------------- #declare plinth = difference{ difference{ difference{ cylinder{<0,-4, 0>, <0,-1.001,0>, Rring} //large cylinder cylinder{<0,-4.01,0>, <0,-1 ,0>, Rring-2} //punch its centre out } box{<0,-4.01,-30>, <-30,-1,30>} //chop it in half diametrically leaving solid ends rotate<0,180-B,0> //rotate it half a module } box{<0,-4.01,-30>, <-30,-1,30>} //chop again to leave a half-module arc } #declare plinths = union{ //form a group of 5 arranged in a circle #declare a = A/4; #while(a < 360) object{plinth rotate<0,a,0>} #declare a = a + A; #end texture{GLASS1} } // ROADS ------------------------------------------------------------------------------------------ #declare road = box{<-1,-4,2>,<+1,-3.99,50>} //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} } // WINDOWS ---------------------------------------------------------------------------------------- #declare VV = -(T2 + O - 00.5); #declare corWins = union{ //corridor windows cylinder{<0,1,1-Rring>, <0,3.5,1-Rring>, 0.75} //skylight cylinder{<0,0,(VV-1)>, <0,0,VV+1>, 0.75 scale<1,1/G,1>} //wall window } #declare smallSky = cylinder{<0,1.5,0>, <0,2.5,0>, 1.0 translate<0,0,-D1>} //for small round room #declare largeSky = cylinder{<0,1.5,0>, <0,2.5,0>, 1.5} //skylight for large round room #declare windows0 = union { //windows of petal unit union{ object{largeSky} object{smallSky rotate<0,+30,0> } object{smallSky rotate<0,-30,0> } translate<0,0,-H> } object{largeSky scale<1/(G*G),1,1> translate<0,0,-R>} //elliptical skylight for middle space object{corWins rotate<0,-B-5,0>} object{corWins rotate<0,-B+5,0>} } #declare windows = merge{ #declare a = 0; #while(a < 360) object{windows0 rotate<0,a,0>} #declare a = a + A; #end } // NINHO ------------------------------------------------------------------------------------------ #declare ninho = union{ difference{ //cut window holes in shell union{ object{FLOORS clipped_by{object{innerSHELL}} texture{Inner_Colour}} union{ difference{ object{outerSHELL} //outer surface of shell cylinder{<0,-1.5,0>, <0,-3,0>, T2+T1} //to give outer surface a flat } difference{ object{innerSHELL} //for inner surface of shell cylinder{<0,-1,0>, <0,-3,0>, T2+T1-1} //to give inner surface a flat } //bottom at floor level texture{Shell_Colour} } } object{windows pigment{color rgbt<1,1,1,1>}} } object{ //add shaped window panes union{object{innerSHELL} object{outerSHELL}} clipped_by{object{windows}} texture{GLASS1} } } // CREATE THE COMPLETE LANDSHARE ------------------------------------------------------------------ #declare landshare = union { // object{ownership} // transparent ellipsoid showing extent of "ownership" space // object{crater} // object{gleba} // circular area with radial colour gradient // object{roads} // object{plinths} object{ninho} } object{landshare clipped_by{box{<-100,-4,-100>,<100,-.8,100>}} //to create floor-plan view // clipped_by{box{<0,-4,-100>,<100,4,100>}} //to create elevation view rotate<0,7,0> // translate<0,0,-14.024554285> //to create a good angled view // translate }