/**********************************************************************************/ // Persistence of Vision Ray Tracer Scene Description File // File name : LandscapeGenerator.pov // Version : 3.5 // Description : Makes isosurface landscapes // uses heightfields to test same landscape (faster!) // obviously, there are thousands of combinations possible! // here are just a few to get you started. // enjoy! // Date : May 2004 // Author : Mike Williams // Compiled : Thomas A. M. de Groot /**********************************************************************************/ #include "functions.inc" #declare Loc = 4; // location of the camera and primary scaling #declare Function = 1; // choose an example (0 - 12) #declare Iso = false; // true for isosurface; false for heightfield #declare Xscale = 10; // increase size of landscape (not scale!) for X #declare Zscale = 10; // increase size of landscape (not scale!) for Z // ---------------------------------------- #declare G = pigment { gradient y //slope {<0.0, 0.1, 0.0> , 0.0 , 1.0 // altitude <0.0, 0.9, 0.0> , 0.0 , 1.0 //} colour_map { [0.04 rgb <0.1,0.4,0.1>] [0.10 rgb <0.5,0.4,0.3>] [0.25 rgb 0.5] [0.65 rgb 1.0] } translate -0.05*y } #switch (Function) #case (1) //Original functions (Mike Williams): #declare P1=function {pattern {leopard turbulence 0.3 scale 0.05}} #declare P2=function {pattern {crackle turbulence 0.3 scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)} #break // Interesting pattern combinations (Thomas de Groot): #case (2) // a broken-up landscape: #declare P1=function {pattern {cells warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (3) // a mountain/valley landscape: #declare P1=function {pattern {leopard warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (4) // a hilly landscapes with 'tors': #declare P1=function {pattern {dents warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (5) // a karstic landscape: #declare P1=function {pattern {agate warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (6) // an extreme karstic landscape: #declare P1=function {pattern {granite warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (7) // a mountainous landscape: #declare P1=function {pattern {bozo warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (8) // hilly with deep valleys: #declare P1=function {pattern {boxed warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (9) // a mountainous landscape: #declare P1=function {pattern {bumps warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (10) // a broken-up landscape: #declare P1=function {pattern {checker warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 * P2(x, 0, z)*1} #break #case (11) // a crackled landscape: #declare P1=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #break #case (12) // hilly with deep valleys: #declare P1=function {pattern {cylindrical warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.05}} #declare P2=function {pattern {crackle warp {turbulence <0.1, 0.9, 0.3> /*octaves 1 omega 0.5 lambda 0.5*/} scale 0.7}} #declare P=function {P1(x, 0, z)*0.3 + P2(x, 0, z)*1} #end // end of switch #if (Iso) isosurface { function {y - P(x, 1, 1-z)} //open max_gradient 5 contained_by {box {<0.5-Xscale*0.5, -1, 0.5-Zscale*0.5>, <0.5+Xscale*0.5, 1, 0.5+Zscale*0.5>}} translate <-0.5, 0, -0.5> scale pigment {G} //translate -Loc/2*x } #else height_field{ function 300, 300 {P((x-0.5)*Xscale+0.5, 0, (y-0.5)*Zscale+0.5)} translate <-0.5, 0, -0.5> scale pigment {G} //translate Loc/2*x } #end camera { location <0, 1,-1.1*Loc> look_at <0, 0, 0> right x*image_width/image_height angle 54 } sky_sphere { pigment { function {abs(y)} color_map {[0.0 color blue 0.9] [1.0 color rgb 1]} } } light_source {<-1000,2000,-1000> colour rgb 1}