// Persistence of Vision Ray Tracer Scene Description File // File: wallofchina.pov // Vers: 3 // Desc: trial on fixing the "wall_of_china"-problem // Date: 98_07_19 // Auth: reinhard //~~~~~~~~~~~~~~~~~~~~Standard scene settings~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions // create a regular point light source light_source { 0*x // light's position (translated below) color red 1.0 green 1.0 blue 1.0 // light's color translate <0, 400, -20> } // create a regular point light source light_source { 0*x // light's position (translated below) color White * 0.6 translate <0.0 , 15.0 ,-55.0> } camera { location <0.0 , 12.0 ,-21.50> look_at <0.0 , 0.0 , 0.0> } // Set a color of the background (sky) background { color red 0.91 green 0.93 blue 0.8 } //********************************************************************************************************** //~~~~~~~~~~~~~~~~~~Declaring your specific variables~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #declare Ground_level = -12 //The level of your ground height_field #declare Wallthick = 1.3 //The thickness of your wall segments #declare Top = 2 //Level of your structure's top #declare Numpoints = 18 //# of points, your structure is defined by #declare i = 0 //a simple counter variable; starts on 0 //********************************************************************************************************* /*The following block defines the course of your pier structures by specifying the end points of the mid axes of the particular segments. This may be done manually (like I did it), or likewise automatically by an apropriate program, even in a separate .crs file (a simple text file with the extension .crs). All you have to do in this case is to include it here by a > #include "my_course.crs" < statement. For sake of correct calculation of your segments' positions always define the endpoints of the axis by threedimensional vectors, even though all y-values should be set to zero.*/ #declare Points = array[Numpoints] #declare Points[0] = <-21, 0, 12> #declare Points[1] = <-17, 0, 12> #declare Points[2] = <-12, 0, -4> #declare Points[3] = <-9, 0, 0> #declare Points[4] = <-7, 0, -2> #declare Points[5] = <-3, 0, 1> #declare Points[6] = <-5, 0, 4> #declare Points[7] = <0, 0, 7> #declare Points[8] = <3, 0, 3> #declare Points[9] = <2, 0, 0> #declare Points[10] = <5, 0, -3> #declare Points[11] = <5, 0, 1> #declare Points[12] = <8, 0, 7> #declare Points[13] = <7, 0, -4> #declare Points[14] = <15, 0, 0> #declare Points[15] = <15, 0, 10> #declare Points[16] = <19, 0, 13> #declare Points[17] = <22, 0, 13> //********************************************************************************************************* //Declares a single wall segment. Should be zero-centered in x-direction and about two units sized since it //gets clipped by planes to correct length later on. #declare Segment= box {<-1, Ground_level-5, -Wallthick/2>, <1, Top, Wallthick/2>} //******************************************************************************************************** //Now it's, where your scene elements come in: height_field {tga "C:\programme\povray\leveller\wall.tga" //the heiht_field-file of your ground profile pigment {Green} scale <70, 7.5, 44> translate <-35, Ground_level, -8> } union{ #while (i < upper_bound( Points)-1) object {Segment scale pigment {gradient x color_map{[0, rgb<0.9, 0.4, 0.2>] [0.35, rgb<0.6, 0.2, 0.2>] [0.35 Black] [0.65 Black] [0.65, rgb<0.9, 0.4, 0.2>] [1, rgb<0.9, 0.4, 0.2>] } } #if (Points[i+1].x != Points[i].x) rotate <0, 180 - degrees(atan2((Points[i+1].z - Points[i].z), (Points[i+1].x - Points[i].x))), 0> #else rotate<0, 90, 0> #end translate Points[i] + (Points[i+1] - Points[i])/2 #if (i > 0) clipped_by{plane{-Clippax, 0 translate Points[i]}} #else clipped_by{plane{(Points[i]-Points[i+1]), 0 translate Points[i]}} #end #if (i < upper_bound(Points)-2) #declare _ax3 = vnormalize(Points[i+1] - Points[i]) #declare _ax4 = vnormalize(Points[i+1] -Points[i+2]) #declare Clippax = _ax3-_ax4 clipped_by{plane{Clippax, 0 translate Points[i+1] }} #else clipped_by{plane{(Points[i+1]-Points[i+2]), 0 translate Points[i+1]}} #end } #declare i = i+1 #end }