// Persistence Of Vision Ray Tracer Scene Description File // File: candles.pov // Vers: 3.5 // Desc: Three candles on a wooden table // Date: 14 October 2001 // Auth: Jonathan Rafael Ghiglia // Feel free to use this code. // Please notice that these macros are not so *customizable* (sp?). They just helped me to model the candles. // If you change some params you can get unexpected results. // I modelled the candles using a technique I saw first in a scene by Jaime Vives Piqueres //----SWITCHES #declare RADIOSITY = 0; #declare AREA_LIGHT = 0; #declare PHOTONS = 0; #declare FOCAL_BLUR = 0; //------ REALLY SLOW #declare TEST_TEXTURE = 0; //-----for testing candles' shape #macro goccia (num,lung,r1,r2,Rad,Ang,Alt,Seed) #local A=seed(Seed); #local i=0; #while (i rotate Ang*y} #local i=i+1; #end #end #macro cand (alt,_r,num_goc,num_goccini,Seed) #local I=seed(Seed); union { difference { blob { threshold 0.5 cylinder {0, alt*y,_r*2,1} #local j=0; #while (j,(0.4-0.2*f/15) strength 1 } #local f=f+1; #end hollow pigment {rgbt 1} interior { media { method 3 emission 1//rgb <1,.7,.25> density { gradient y color_map { [0 rgb <.2,.3,.8>*0.8] [.3 rgb <1,.7,.25>] } scale 2} density { spherical color_map { [0.45 rgb 1] [.5 rgb 0]} scale 1.5/4 translate 0.3*y} } } rotate rand(I)*360*y scale <_r,2.5*_r,_r>*2 translate (alt+1)*y no_shadow} light_source { <0,alt+1+2*_r,0> rgb <1,.75,.5> fade_distance 50 fade_power 2//3 #if (AREA_LIGHT) area_light 1.5*x,1.5*y,3,3 adaptive 0 jitter orient circular #end media_attenuation on } //-------glow box {-1,1 hollow no_shadow pigment {rgbt 1} interior { media { method 3 emission 0.035 density { spherical color_map { [0 rgb 0] [1 rgb <1,.7,.35>] } turbulence 0.1 poly_wave 2 } } } translate y/2 scale <_r,_r,_r>*9 translate alt*y} } #end #declare pa=array[14] #declare pa[0]=<-10,0>; #declare pa[1]=<0,0>; #declare pa[2]=<4,1>; #declare pa[3]=<6,7>; #declare pa[4]=<2,10>; #declare pa[5]=<2,15>; #declare pa[6]=<2,16.5>; #declare pa[7]=<1.5,17>; #declare pa[8]=<1.5,15>; #declare pa[9]=<1.5,10>; #declare pa[10]=<5.5,7>; #declare pa[11]=<3.5,1>; #declare pa[12]=<0,0.7>; #declare pa[13]=<-5,1>; #declare porta_candela= lathe { cubic_spline 14, #local sp=0; #while (sp<14) pa[sp] #local sp=sp+1; #end sturm photons {target reflection on refraction off collect off} } #declare holder_metal= texture { pigment {rgb <1,.95,.9>}// rgb <1,.9,.8> finish {diffuse .4 specular 1.2 roughness 0.02 reflection {.5 metallic} brilliance 4 metallic} normal {granite -0.3 cubic_wave scale 5} } global_settings { ambient_light 0 max_trace_level 15 #if (PHOTONS) photons {count 1000000 autostop 0} #end #if (RADIOSITY) radiosity { pretrace_start 1 pretrace_end 1 count 50 error_bound 1 gray_threshold 0.0 } #end } #macro wax (Color) material { texture { pigment { Color transmit 0.6} finish {diffuse 0.65 specular 0.35 roughness 0.02} } interior {ior 1.1 media { method 3 intervals 1 samples 20 scattering {1, Color*0.8 extinction 1} } } } #end #macro tex() texture {pigment {Wheat} finish {diffuse 0.65 specular 0.35 roughness 0.02}} #end #include "colors.inc" #include "woods.inc" #declare Wood = texture { pigment { P_WoodGrain3A color_map { M_Wood4A }}} texture { pigment { P_WoodGrain3B color_map { M_Wood4B }}} cylinder {-10*y,-15*y,85 translate 20*z texture {Wood scale 8 rotate -30*y finish {ambient 0 diffuse 0.65 specular 0.2 roughness 0.015 reflection { 0.25,0.85 falloff 3 exponent 0.95}}} } camera { location <0,30,-50> look_at 10*y #if (FOCAL_BLUR) aperture 1 focal_point <10,10,-5> blur_samples 40 variance 0 #end } object { cand (20,1.5,10,50,0) hollow double_illuminate #if (TEST_TEXTURE) tex() #else wax (Wheat) #end translate <10,0,-5>} object { cand (25,1.5,12,50,0) hollow double_illuminate #if (TEST_TEXTURE) tex() #else wax (Wheat) #end translate <-20,0,-55>} object { cand (22,1.5,10,50,0) hollow double_illuminate #if (TEST_TEXTURE) tex() #else wax (Wheat) #end translate <-30,0,30>} object {porta_candela texture {holder_metal} scale <1.05,1,1.05> translate <-30,-10,30>} object {porta_candela texture {holder_metal} scale <1.05,1,1.05> translate <-20,-10,-55>} object {porta_candela texture {holder_metal} scale <1.05,1,1.05> translate <10,-10,-5>} //#include "c:\documenti\mypovscenes\binoculars.pov" //-----room difference { box {-0.5,0.5 scale <6,4,8>*110} box { -0.5,0.5 scale <100*6,100*4,100*8>} box {-0.5,0.5 //----a window scale <1,1.5,1.5>*100 translate <300,100,0> } hollow pigment {rgb 0.9} finish {diffuse 0.85} } plane {y, -100 pigment {rgb 0.7} finish {diffuse 0.7} } //------background background {rgb <.6,.8,1>*0.45}