/********************************************************************************** Persistence of Vision Ray Tracer Scene Description File File name : DJ_TOK_FieldCam_test.pov Version : 3.8 Description : Testing the use of the FieldCam macro by Doctor John (2005). Rewriting by Thor Olav Kristensen: Date : November 2021 Author : Thomas A. M. de Groot E-mail : **********************************************************************************/ // Render settings (right-click on a line below): // +w640 +h640 +a0.3 +am2 +bm2 +bs8 +wt7 //-------------------------------------------------------------------------- #version 3.8; global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 pretrace_end 0.01 count 50, 1000 nearest_count 10, 5 error_bound 1 recursion_limit 2 low_error_factor .3 gray_threshold 0.0 minimum_reuse 0.015 maximum_reuse 0.1 brightness 1 adc_bailout 0.01/2 normal off media off always_sample off //max_sample 1.0 } } //-------------------------------------------------------------------------- #macro FieldCameraTransform_UpY(pLocation, pLookAt) #local vDirection = pLookAt - pLocation; #local vDirXZ = vDirection*(x + z); #local SqrXZ = vdot(vDirXZ, vDirXZ); #if (SqrXZ = 0) #error "The viewing vector is perpendicular to the XZ-plane.\n" #end // if #local vS = vDirection.y/SqrXZ*vDirXZ; transform { matrix < 1, 0, 0, vS.x, 1, vS.z, 0, 0, 1, 0, 0, 0 > translate -pLocation.y*vS } #end // FieldCameraTransform_UpY //-------------------------------------------------------------------------- // camera ------------------------------------------------------------------ #declare FC = on; //use of Dr John's FieldCam macro #declare H = 0; //height of ground plane #declare AspectRatio = image_width/image_height; #declare CamZoom = 0.83; #declare CamSky = <0, 1, 0>; #declare CamAng = 50; #declare Test = 3; #switch (Test) #case (1) #declare CamLoc = <0.0, H+1, -40.0>; #declare CamLookAt = <0.0, H+30, 100.0>; #break #case (2) #declare CamLoc = <2000.0, H+1, -2400.0>; #declare CamLookAt = <2000-100, H+50, -2400+100>; #end #declare Camera = #if (FC) camera { perspective location CamLoc sky CamSky up CamSky FieldCameraTransform_UpY(CamLoc, CamLookAt) right x*AspectRatio angle CamAng look_at CamLookAt } #else camera { perspective location CamLoc sky CamSky up CamSky direction z*CamZoom right x*AspectRatio angle CamAng look_at CamLookAt } #end camera {Camera} // sun --------------------------------------------------------------------- light_source {<-15000,25000,-35000> color 1} // sky --------------------------------------------------------------------- sky_sphere { pigment { gradient <0, 1, 0> color_map { [0.00 rgb <1.0,1.0,1.0>] [0.30 rgb <0.0,0.1,1.0>] [0.70 rgb <0.0,0.1,1.0>] [1.00 rgb <1.0,1.0,1.0>] } scale 2 } } plane { y, H+1000 texture { pigment { wrinkles warp {turbulence <1.0, 2, 3>*10} pigment_map { [0.4 srgbt <0.9, 0.9, 0.9, 1.0>] [0.5 srgbt <0.9, 0.9, 0.9, 0.3>] [0.5 srgbt <0.9, 0.9, 0.9, 0.0>] [0.6 srgbt <0.9, 0.9, 0.9, 0.0>] [0.7 srgbt <0.9, 0.9, 0.9, 0.4>] [0.8 srgbt <0.9, 0.9, 0.9, 1.0>] } scale <500, 800, 1000>*500 warp {turbulence <20.0, 50.0, 30.0>} } //normal {bumps 0.75 scale 0.025 } finish {diffuse 0.2 emission 0.8} } } // ground ------------------------------------------------------------------ plane { y, H texture { pigment {srgb <0.825, 0.57, 0.35>} normal {bumps 0.75 scale 0.025 } finish {diffuse 0.8} } } //-------------------------------------------------------------------------- //---------------------------- objects in scene ---------------------------- //-------------------------------------------------------------------------- #local Pillar = union { box {<-2, H, -2>, <2, H+20, 2>} box {<-3, H, -3>, <3, CamLoc.y+1, 3>} pigment { cells colour_map { [0.8 rgb <0.2, 0.5, 0.5>] [0.8 rgb <0.9, 0.9, 0.9>] } scale 0.4 } finish { diffuse 0.8 } } #switch (Test) #case (1) object {Pillar rotate 30*y translate <5, 0, -6> } object {Pillar rotate 50*y translate <-12, 0, 8> } object {Pillar rotate -20*y translate <15, 0, 15> } #break #case (2) union { object {Pillar rotate 30*y translate <-5, 0, -5> } object {Pillar rotate 50*y translate <-18, 0, 15> } object {Pillar rotate -20*y translate <10, 0, 15> } translate } #end //-----------------------------------------------------------------------