/* POVRAY PROGRAM TO CREATE THE 5-PETAL VERSION OF THE UNIVERSAL TERRESTRIAL DWELLING By: ROBERT JOHN MORTON YE572246C COMMAND LINE: povray -visual DirectColor five-petal.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" // CAMERA ---------------------------------------------------------------- global_settings { max_trace_level 256 } // max possible is 256 #declare gr = 1.618033988749894848204586834365638117720; // the golden ratio #declare tr = -15; //radial shift of each petal from centre #declare r = 1; #declare h = 2000; #declare l = h * r; camera { // establish a camera to view the scene location <0, h, l> look_at <0, 0, 0> // camera is looking at a point a little to the right and in front of the origin angle 1 // the aperture angle. This affects the zooming of the scene. } // LIGHTING -------------------------------------------------------------- // 1) Simulate the sun light_source { // cylinder light <450, 1000, 800> // located quite high, well forward and a little to the left color White // white light cylinder // confined to a cylindrical beam radius 70 // of radius 30 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 arral 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 light_source { // cylinder light <450, 1000, 800> // located quite high, well forward and a little to the left color rgb <.8,.7,.6> // white light cylinder // confined to a cylindrical beam radius 70 // of radius 30 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 arral 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 // 2) simulate light from the horizon light_source { < 0, 50, 500> color rgb <.6, .8, 1> } // ordinary point source of horizon light light_source { < 433, 50, -250> color rgb <.6, .8, 1> } // ordinary point source of horizon light light_source { <-433, 50, -250> color rgb <.6, .8, 1> } // ordinary point source of horizon light // BACKGROUND ------------------------------------------------------------ #declare LandArea = texture { pigment { agate turbulence 1 lambda 1.5 omega .8 octaves 8 color_map { [0.00 color rgb <.5, .25, .15>] [0.33 color rgb <.1, .5, .4>] [0.86 color rgb <.6, .3, .1>] [1.00 color rgb <.5, .25, .15>] } } } plane { y, -4 // create a ground plane texture { // define its texture that comprises: pigment { color rgb <0.8, 1.0, 0.5> // colour field-green rgb <0.8, 1.0, 0.5> } finish { // with surface characteristics: diffuse 0.2 // diffusion ambient 0.3 // effective ambient lighting (brightness) } } } 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 p = 0.7; // major colour level #declare q = 0.5; // minor colour level #declare s = 0.3; // lower intermediate colour #declare w = 0.6; // higher intermediate colour #declare h = 0.4; // 'absent' component #declare RED = texture { pigment { agate agate_turb 0.5 color_map { [0.00 color ] // red [s color ] // cyan [w color ] // yellow [1.00 color ] // red } } finish { phong 0.8 } } #declare GREEN = texture { pigment { agate agate_turb 0.5 color_map { [0.00 color ] // green [s color ] [w color ] [1.00 color ] // green } } finish { phong 0.8 } } #declare BLUE = texture { pigment { agate agate_turb 0.5 color_map { [0.00 color ] // blue [s color ] [w color ] [1.00 color ] // blue } } finish { phong 0.8 } } // OBJECTS -------------------- Dimensions in Metres ------------------------- /* GEOMETRY OF THE CIRCLES TO FIND THE CENTRE ABOUT WHICH THE ELLIPSOID SHOULD BE PIVOTED sin q = 1.50 / 7 therefore q = 12.373625116188557992309037179651 cos p = 2.75 / 7 therefore p = 66.867603600702136359352172295334 angle w = 90 - (p + q) = 10.758771283109305648338790525015 sin w = 1.5 / pivrad therefore pivrad = 1.5 / sin w see geometry.bmp in this folder */ #declare w = 10.758771283109305648338790525015; // degrees of arc #declare pivrad = 8.0353798863689354589465384245257; // metres // CONSTRUCT THE FLOOR TRIAD #declare th = 23.132396399297863640647827704666; // semi-angle of triad in degrees #declare lc = cylinder { <0,-1.05,0>, <0,-1,0> 2.5 texture { RED } translate <0,0,7> } #declare bc = cylinder { <0,-1.05,0>, <0,-1,0> 4.045 texture { RED } } #declare T = merge { // FORM THE TRIAD OF CIRCULAR FLOORS object { bc } // large circular floor object { lc rotate <0,+th,0> } // left small circular floor object { lc rotate <0,-th,0> } // right small circular floor translate <0, 0, pivrad> } #declare C0 = cylinder { // LARGE HOLE IN PATIO ROOF <0,0.5,0>, <0,2.05,0> 3 // 6 metres diameter pigment { color rgbt<1,1,1,1> } // totally invisible } #declare C1 = cylinder { // SMALL HOLE IN PATIO ROOF <0,0.5,0>, <0,2.05,0> 2 // 4 metres diameter pigment { color rgbt<1,1,1,1> } // totally invisible translate <0,0,7> // move radially to the position of the small floor } #declare C = cylinder { <0,1.980,0>, <0,2.00,0> 1 } // cylinder 2 metres diameter #declare C2 = object { C pigment { color rgbt<1,1,1,1> } } // skylight hole #declare C3 = object { C texture { T_Glass4 } interior { I_Glass } } // skylight GLASS #declare H1 = merge { // construct the triad of holes for the petal object { C2 } // central skylight hole object { C2 translate <0,0,7> rotate <0,+th,0> } // left skylight hole object { C2 translate <0,0,7> rotate <0,-th,0> } // right skylight hole translate <0,0,pivrad> } #declare H2 = merge { // construct the triad of holes for the patio object { C2 } // central skylight hole object { C1 rotate <0,+th,0> } // left patio hole object { C1 rotate <0,-th,0> } // right patio hole translate <0,0,pivrad> } #declare H3 = merge { // construct the triad of holes for the petal object { C2 translate <0,0,7> rotate <0,+th,0> } // left skylight hole object { C2 translate <0,0,7> rotate <0,-th,0> } // right skylight hole translate <0,0,pivrad> } #declare S = merge { // OBJECT COMPRISING THE 3 SKYLIGHTS object { C3 } // central skylight object { C3 translate <0,0,7> rotate <0,+th,0> } // left skylight object { C3 translate <0,0,7> rotate <0,-th,0> } // right skylight translate <0,0,pivrad> } #declare S3 = merge { // OBJECT COMPRISING THE 2 SKYLIGHTS + LARGE HOLE object { C3 translate <0,0,7> rotate <0,+th,0> } // left skylight object { C3 translate <0,0,7> rotate <0,-th,0> } // right skylight translate <0,0,pivrad> } // FORM THE ENVELOPE OF THE PETAL #declare A = sphere { // BASIC ELLIPSOID OBJECT FROM WHICH TO MAKE THE PETAL ENVELOPE <0, 0, 0>, 2 hollow // form a sphere of radius 5 metres scale <2.5, 1, 4> // squash its lateral and vertical axes translate <0, 0, pivrad+2.6> // translate to its radial position } #declare ww = w / 20; #declare P = merge { // Form petal by revolving THE BASIC ELLIPSOID OBJECT #declare j = -w; // one degree at a time over a 24 degree arc. #while( j <= w) // CENTRED ON THE PIVOT POINT object { A rotate <0, j, 0> } #declare j = j + ww; #end texture { GREEN } } #declare P0 = union { // bedroom petal unit difference { object { P } // generic petal envelope object { H3 } // holes for the peripheral skylights only object { C0 translate <0,0,pivrad> } // large patio hole for large floor } object { S3 } // skylights object { T } // floors } #declare P1 = union { // closed petal unit difference { object { P } // generic petal envelope object { H1 } // holes for the skylights } object { S } // skylights object { T } // floors } #declare P2 = union { // open patio unit difference { object { P } // generic petal envelope object { H2 } // holes for skylight and open roofs } object { C3 translate <0,0,pivrad> } // central skylight object { T } // triad of circular floors } #declare trans = 2.5; // extra radial shift for each petal #declare F = merge { object { P2 translate <0,0,trans> } //the single bedroom unit object { P0 translate <0,0,trans> rotate <0,72,0> } //the single patio unit object { P1 translate <0,0,trans> rotate <0,144,0> } //the single bedroom unit object { P0 translate <0,0,trans> rotate <0,216,0> } //the single bedroom unit object { P1 translate <0,0,trans> rotate <0,288,0> } //the single bedroom unit } object { F // clipped_by { box { <-40,-2.5,-40>, <40,0,40> } } // creates open view of floors inside rotate <0,18,0> }