// PoVRay 3.7 Scene File " ... .pov" // author: ... // date: ... // +w1000 +h650 +a0.3 +am2 +bm2 +wt6 //-------------------------------------------------------------------------- #version 3.7; global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 pretrace_end 0.004 count 50, 500 nearest_count 10, 5 error_bound 0.6 recursion_limit 2 low_error_factor .3 gray_threshold 0.0 minimum_reuse 0.010 maximum_reuse 0.1 brightness 1 adc_bailout 0.01/2 normal off media off always_sample off //max_sample 1.0 } } #default{ finish{ ambient 0.0 diffuse 0.7 }} //-------------------------------------------------------------------------- #include "colors.inc" #include "shapes.inc" #include "rand.inc" //-------------------------------------------------------------------------- // camera ------------------------------------------------------------------ #declare Camera_0 = camera {perspective angle 75 // front view location <0.0 , 2.0 ,-3.0> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} #declare Camera_1 = camera {/*ultra_wide_angle*/ angle 90 // diagonal view location <2.0 , 2.5 ,-3.0> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} #declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90 //right side view location <0.0 , 2.0 , -2.8> right x*image_width/image_height look_at <0.0 , 0.0 , 0.0>} #declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90 // top view location <0.0 , 3.0 ,-0.001> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} camera{Camera_2} // sun ---------------------------------------------------------------------- light_source{< -3000,3000,3000> color White} // sky ---------------------------------------------------------------------- sky_sphere { pigment { gradient <0,1,0> color_map { [0.00 rgb <0.6,0.7,1.0>] [0.35 rgb <0.1,0.0,0.8>] [0.65 rgb <0.1,0.0,0.8>] [1.00 rgb <0.6,0.7,1.0>] } scale 2 } // end of pigment } //end of skysphere // ground ------------------------------------------------------------------- plane{ <0,1,0>, 0 texture{ pigment{ color srgb<1.0, 0.9, 0.0>} } // end of texture } // end of plane //--------------------------------------------------------------------------- //---------------------------- objects in scene ---------------------------- //--------------------------------------------------------------------------- // ----------------- HF_Square macro ------------------ #declare Fn_1 = function(x, y, z) {1-(-f_snoise3d(x*2,y*2,z*2)*0.25)} // ----------------------------------------------------- #declare Surface = object{ HF_Square( Fn_1, //Function, 0, // UseUVheight: 0 or 1 1, // UseUVtexture: 0 or 1 <50,50>, // Resolution, 1, // Smooth: 0 or 1 "",// FileName, ""=no file, <-1,0,-1>*2, //MnExt, <1,1,1>*2 //MxExt ) //------------------------------ texture{ pigment{ checker color srgb <0.7, 0.6, 0> color srgb <0.8, 0.7, 0> scale 0.05} finish { phong 0.1} } // end of texture scale <1.5,0.5,1.5>*1 rotate<0,0,0> //translate <0,-1.5,0> } object {Surface} // ----------------------------------------------------- #declare Block = difference { box { <-1.00, -1.00, -1.00>,< 1.00, 1.00, 1.00> scale <1.5, 1, 1.5> } cylinder { <0, -1.5, 0>, <0, 2.00, 0>, 0.50 scale <1, 1 ,1> translate <-0, 0, 0> } cylinder { <0, -1.5, 0>, <0, 2.00, 0>, 0.70 scale <1, 1 ,1> translate <-0.5, 0, 0.5> } cylinder { <0, -1.5, 0>, <0, 2.00, 0>, 0.50 scale <1, 1 ,1> translate <0.5, 0, -0.5> } cylinder { <0, -1.5, 0>, <0, 2.00, 0>, 0.40 scale <1, 1 , 1> translate <0.0, 0, -1.0> } rotate 35*y } // ----------------------------------------------------- #declare House = box { <-1.00, -1.00, -1.00>,< 1.00, 1.00, 1.00> scale <1,1,1>*0.1 } #declare Floor = box { <-1.00, 0.00, -1.00>,< 1.00, 1.00, 1.00> scale <1,1,1>*0.1 } #declare Dome = difference { sphere { <0,0,0>, 1 scale <1, 0.9, 1>*0.09 } plane {y, 0} } #declare Terrace = box { <-1.00, 0.00, -1.00>,< 1.00, 10.00, 1.00> scale <1,1,1>*0.09 translate 0.08*y } // ----------------------------------------------------- #declare Rand = seed (19323); #declare Counter = 0; #declare RandProb = seed (9673); #declare DomeProb = 0.1; #declare Floor1Prob = 0.5; //first house to start the block's union #declare Norm = <0, 0, 0>; #declare Start = VRand_In_Obj(Block, Rand); #declare Pos = trace (Surface, Start+<0, 100, 0>, -y, Norm ); #declare HouseBlock = object {House scale rotate RRand(-10, 10, Rand)*y translate Pos } //incremental houses #while (Counter <= 200) #declare Norm = <0, 0, 0>; #declare Start = VRand_In_Obj(Block, Rand); #declare Pos = trace (Surface, Start+<0, 100, 0>, -y, Norm ); #if (!inside(HouseBlock, Pos)) #declare Floorer = Prob (Floor1Prob, RandProb); #declare Domer = Prob (DomeProb, RandProb); #declare HouseBlock = #if (Floorer & ! Domer) #local Trans = transform { scale rotate RRand(-10, 10, Rand)*y } difference { #end //of Floorer & Domer union { object {HouseBlock} #if (Floorer) #if (Domer) union { object {House} object {Floor translate 0.1*y} object {Dome translate 0.2*y} scale rotate RRand(-10, 10, Rand)*y translate Pos } #else union { object {House} object {Floor translate 0.1*y} transform {Trans} translate Pos } #end //of Domer #else object {House scale rotate RRand(-10, 10, Rand)*y translate Pos } #end //of Floorer } //HouseBlock union #if (Floorer & ! Domer) object {Terrace translate 0.1*y transform {Trans} translate Pos } } //HouseBlock difference #end //of Floorer & Domer #declare Counter = Counter + 1; #debug concat("houses: ", str(Counter,4,0),"\n") #else //#debug " no location found.\n" #end //of inside #end //of Counter //intersection { //object {Block} object {HouseBlock//} texture { pigment {color rgb 1} finish { specular 0.02 roughness 0.005 diffuse 0.7 } } } //intersection