//============================================================================== // Persistence of Vision Ray Tracer Scene Description File //------------------------------------------------------------------------------ // File : FrostyBall2.pov // Version : 3.7 // Description : A frosty media sphere floating in 3 spotlight beams // Date : 11/26/2014 // Author : Robert W. McGregor, Rob@McGregorFineArt.com // Command-line : +w1920 +h1080 +fe +a0.1 +r5 +kfi1 +kff7 // Each frame (1-7) lights a different color or color combination //============================================================================== #version 3.7; #include "shapes.inc" #include "rand.inc" global_settings { assumed_gamma 1 noise_generator 3 radiosity { recursion_limit 3 pretrace_start 0.08 pretrace_end 0.005 normal off always_sample off } } //------------------------------------------------------------------------------ // Scene switches //------------------------------------------------------------------------------ #declare Render_Atmosphere = 1; #declare Render_light_beams = 1; #declare Render_light_glows = 1; #declare Render_light_orbs = 1; #declare Render_Frosty_Ball = 1; //------------------------------------------------------------------------------ // Camera //------------------------------------------------------------------------------ #declare Cam_Loc = <7, 2, -6>; #declare Cam_At = <0.7, 2.2, 0>; camera { location Cam_Loc look_at Cam_At right up <0, 1, 0> angle 68 } //------------------------------------------------------------------------------ // Glow //------------------------------------------------------------------------------ #macro Glow_Orb(pos, clr, scl) #if (Render_light_glows) union { box { -0.5,0.5 hollow no_shadow scale z*0.01 texture { Glow(clr) scale scl } Reorient_Trans(-z, Cam_Loc-Cam_At) // always face the camera translate pos } sphere { pos, 0.02 no_shadow hollow pigment { clr } finish { emission 5 } } } #else object { sphere { pos, 0.02 no_shadow hollow pigment { clr } finish { emission 1 } } #end #end #macro Glow(clr) pigment_pattern { // transparency gradient spherical poly_wave 100 // ramp toward center, smoothly fading edges color_map { [0 rgb 0] [1 rgb 1] } } texture_map { [0 pigment { rgbt 1 } finish { diffuse 0 emission 0 } ] [1 pigment { color clr } finish { diffuse 0 emission 1 } ] } #end //------------------------------------------------------------------------------ // Lights //------------------------------------------------------------------------------ #macro SpotLight(pos, clr) light_source { pos color clr spotlight point_at <0, 0, 0> radius 20 tightness 25 falloff 25 media_attenuation on } #end #declare BRIGHTNESS = 7; // Red light #declare lightClr1 = rgb <1,0.35,0.35>*BRIGHTNESS; #declare lightPos1 = <0,5,0>; #declare RedLight = SpotLight(lightPos1, lightClr1) #declare RedLightOrb = Glow_Orb(lightPos1, lightClr1/5, 4) // Green light #declare lightClr2 = rgb <0.35,1,0.35>*BRIGHTNESS; #declare lightPos2 = <-2,5.1,0.5>; #declare GreenLight = SpotLight(lightPos2, lightClr2) #declare GreenLightOrb = Glow_Orb(lightPos2, lightClr2/5, 4.5) // Blue light #declare lightClr3 = rgb <0.35,0.35,1>*BRIGHTNESS; #declare lightPos3 = <2,4.5,-0.5>; #declare BlueLight = SpotLight(lightPos3, lightClr3) #declare BlueLightOrb = Glow_Orb(lightPos3, lightClr3/5, 3.5) //----------------------------------------------------------------------------- // all possible lighting combinations, driven by animation frame number #switch (frame_number) #case (1) #if (Render_light_beams) light_source { RedLight } #end #if (Render_light_orbs) object { RedLightOrb } #end #break #case (2) #if (Render_light_beams) light_source { GreenLight } #end #if (Render_light_orbs) object { GreenLightOrb } #end #break #case (3) #if (Render_light_beams) light_source { BlueLight } #end #if (Render_light_orbs) object { BlueLightOrb } #end #break #case (4) #if (Render_light_beams) light_source { RedLight } #end #if (Render_light_orbs) object { RedLightOrb } #end #if (Render_light_beams) light_source { GreenLight } #end #if (Render_light_orbs) object { GreenLightOrb } #end #break #case (5) #if (Render_light_beams) light_source { RedLight } light_source { BlueLight } #end #if (Render_light_orbs) object { RedLightOrb } object { BlueLightOrb } #end #break #case (6) #if (Render_light_beams) light_source { GreenLight } light_source { BlueLight } #end #if (Render_light_orbs) object { GreenLightOrb } object { BlueLightOrb } #end #break #case (7) #if (Render_light_beams) light_source { GreenLight } light_source { RedLight } light_source { BlueLight } #end #if (Render_light_orbs) object { GreenLightOrb } object { RedLightOrb } object { BlueLightOrb } #end #break #end //------------------------------------------------------------------------------ // Frosty ball //------------------------------------------------------------------------------ #declare R = seed(1963*clock); #declare f_Steam = function { pigment { aoi poly_wave 2 pigment_map { [0.5 bozo turbulence 0.75 scale 0.125/2 color_map { [0 rgb 0] [0.5 rgb 1] [1 rgb 1] } omega 0.7 lambda 2.2 octaves 3 ] [1.0 rgb 1] } } } #macro Frosty_Ball() sphere { <0,0,0>, 3.25 pigment { rgbt 1 } hollow finish { ambient 0 emission 0 specular 0 brilliance 0 diffuse 0 phong 0 reflection 0 } interior { ior 1.0 media { scattering { 4, 5 extinction 1 } absorption 10 samples 48,96 intervals 2 density { function { f_sphere(x, y, z, 1) + f_Steam(x/2, y/2, z/2).hf*0.35 } } density { spherical poly_wave 1.5 density_map { [0.0 rgb 0] [1.0 rgb 1] } scale 0.95 } } } rotate } #end //------------------------------------------------------------------------------ // atmospheric media container //------------------------------------------------------------------------------ #if (Render_Atmosphere) // spotlight beam atmospheric turbulence #declare f_Steam2 = function { pigment { bozo turbulence 0.25 scale 0.05 color_map { [0 rgb 0.65] [0.4 rgb 1] [1 rgb 1] } omega 0.7 lambda 2.2 octaves 4 translate clock } } sphere { <0,0,0>, 30 hollow interior { ior 1.0 media { scattering { 4, rgb 0.1 extinction 1 } density { function { f_Steam2(x/2, y/2, z/2).hf+f_Steam2(x/2.35, y/2.35, z/2.35).hf } } samples 48,96 intervals 2 } } } #end //------------------------------------------------------------------------------ // Frosty ball #if (Render_Frosty_Ball) object { Frosty_Ball() translate y*1.5 } #end // floor box { -4, 4 hollow scale y*0.01 }