// Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3.6 // Desc: Basic Scene Example // Date: mm/dd/yy // Auth: ? // #version 3.6; #include "colors.inc" #include "math.inc" global_settings { assumed_gamma 1 ambient_light 1/8 } // ---------------------------------------- camera { // orthographic location -z * 10 direction +z * 10 up 2*y*image_height/image_width right 2*x // rotate -x*30 translate y/4 scale 40 } light_source { x * 1000 // light's position (translated below) color rgb 1 // light's color parallel rotate z * 60 rotate y * 60 // shadowless } background {color rgb 0} // ---------------------------------------- #local Points_Number = 12; #macro get_new_point(cutclock, point, step) #local uold = interp_array[Points_Number - 1 - point][0].u; #local vold = interp_array[Points_Number - 1 - point][0].v; #if (step = 1) #local uval = interp_array[point][step].u; #local vval = interp_array[point][step].v; #else #local uval = Interpolate(cutclock, 0, 1, interp_array[point][step-1].u, interp_array[point][step].u, 1); #local vval = Interpolate(cutclock, 0, 1, interp_array[point][step-1].v, interp_array[point][step].v, 1); #end * <-1,1,> #end #macro interpolate_spline(point) #local time = clock * 100; #switch (time) #case (0) #local addvalue = get_new_point(0, point, 1); #break #range (0,15) #local mintime = 0; #local maxtime = 15; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 2); #break #range (15,25) #local mintime = 15; #local maxtime = 25; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 3); #break #range (25,40) #local mintime = 25; #local maxtime = 40; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 4); #break #range (40,60) #local mintime = 40; #local maxtime = 60; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 5); #break #range (60,80) #local mintime = 60; #local maxtime = 80; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 6); #break #range (80,100) #local mintime = 80; #local maxtime = 100; #local cutclock = (time-mintime)/(maxtime-mintime); #local addvalue = get_new_point(cutclock, point, 7); #break #end addvalue #end #declare interp_array = array[Points_Number] { // ref, 0, 15, 25, 40, 60, 80, 100 array[8] {<-7.08276,0,>, <0,-35.7224,>, <0,-30.5308,>, <0,-25.3392,>, <0,-19.4267,>, <0,-13.5142,>, <0,-6.75711,>, <0,0,>, }, array[8] {<-6.86244,1.20458,>, <2.33584,-34.7843,>, <1.99351,-29.6869,>, <1.65118,-24.5895,>, <0.745905,-18.92625,>, <-0.15937,-13.263,>, <-1.19397,-6.79067,>, <-2.22857,-0.318367,>, }, array[8] {<-4.07112,7.22746,>, <7.85463,-30.545,>, <6.49651,-26.0295,>, <6.81056,-21.2401,>, <5.22143,-16.2841,>, <3.6323,-11.3281,>, <1.81615,-5.66403,>, <0,0,>, }, array[8] {<-6.60795,11.8451,>, <6.02815,-22.4413,>, <5.32512,-19.2763,>, <5.32512,-14.2514,>, <4.08259,-10.926085,>, <2.84006,-7.60077,>, <1.42003,-3.80039,>, <0,0,>, }, array[8] {<-4.30345,14.6173,>, <-1.73389,-18.2258,>, <-1.94325,-16.632,>, <-1.94325,-13.413,>, <-1.489825,-10.283305,>, <-1.0364,-7.15361,>, <-0.518199,-3.5768,>, <0,0,>, }, array[8] {<-3.71571,23.6602,>, <-3.23359,-23.4687,>, <-3.23359,-23.4687,>, <0.728299,-19.9909,>, <0.899107,-15.7758,>, <0.599405,-10.5172,>, <0.299702,-5.2586,>, <0,0,>, }, array[8] {<-9.18321,23.1906,>, <-11.1743,-25.0046,>, <-11.1743,-25.0046,>, <-3.08747,-21.915,>, <-2.8095,-16.4795,>, <-1.873,-10.9863,>, <-0.936499,-5.49315,>, <0,0,>, }, array[8] {<-8.24467,18.0436,>, <-13.0595,-16.0463,>, <-13.0595,-16.0463,>, <-3.16683,-9.54191333333333,>, <-1.126358,-7.91581666666667,>, <-0.61624,-6.28972,>, <-0.106122,-0.636734,>, <-0.106122,-0.636734,>, }, array[8] {<-13.5667,22.2521,>, <-13.243,-13.3531,>, <-13.243,-13.3531,>, <-4.85851,-12.44505,>, <-0.0308412,-11.537,>, <0.9717194,-6.88748,>, <1.97428,-0.670705,>, <-0.52572,-0.670705,>, }, array[8] {<-12.9202,30.4391,>, <-18.2813,-9.25749,>, <-18.2813,-9.25749,>, <-11.994335,-9.25749,>, <-5.70737,-9.25749,>, <-3.2311505,-5.63277,>, <-0.754931,1.69796,>, <-0.754931,1.69796,>, }, array[8] {<-4.8858,34.7341,>, <-17.9936,-3.25312,>, <-17.9936,-3.25312,>, <-12.6098,-3.25312,>, <-6.87937,-3.25312,>, <-1.19621,-2.22656,>, <0.141582,-1.2,>, <0.14,0.266193,>, }, array[8] {<0,35.6957,>, <-20.254,-4.19047,>, <-20.254,-4.19047,>, <-4.2211632,-4.19047,>, <-1.2150063,-4.19047,>, <-0.546971433333333,-4.19047,>, <-0.379962716666667,-4.19047,>, <-0.212954,0,>, }, } #declare Max_Height = 35.6957; #declare Smooth_Fraction = 20/Max_Height; #declare Fire_Fraction = 20/Max_Height; #declare Height_Fraction = interpolate_spline(3).v/Max_Height; #declare Transparency = 0; #declare Stem_Speed = interpolate_spline(06).v/Max_Height; #declare Crown_Radius = interpolate_spline(3).u/-interp_array[3][0].u; #declare Crown_Speed = Stem_Speed * 2/3; #declare Turb_Amount = 1/4; #declare YTurb_Amount = 1/2; #declare stem_texture_a = texture { // pigment {color rgb 1 transmit Transparency} pigment {color rgb 1} normal { bumps noise_generator 3 scale 1/Max_Height warp {turbulence } } translate y * Stem_Speed } #declare crown_texture_a = texture { // pigment {gradient y color_map {[0 color rgb x transmit Transparency][1 color rgb y transmit Transparency]}} pigment {color rgb 1} normal { bumps 1/4 noise_generator 3 scale 1/Max_Height scale 1/2 warp {turbulence } } translate -y * Crown_Speed } #declare crown_texture_b = texture { // pigment {color rgb z transmit Transparency} pigment {color rgb 1} normal { bumps 1/4 noise_generator 3 scale 1/Max_Height warp {turbulence } } translate -y * Crown_Speed } #declare fire_texture_a = texture { // pigment {gradient y color_map {[0 color rgb x transmit Transparency][1 color rgb y transmit Transparency]}} pigment { bumps color_map {[0 rgb 0][1 rgb <248,197,112,>/255 * 2]} warp {turbulence } } normal { bozo warp {turbulence } } finish {ambient 2} scale 1/Max_Height translate -y * Crown_Speed } #declare fire_texture_b = texture { // pigment {gradient y color_map {[0 color rgb x transmit Transparency][1 color rgb y transmit Transparency]}} pigment { bumps color_map {[0 rgb 0][1 rgb <248,197,112,>/255 * 2]} warp {turbulence } } normal { bozo warp {turbulence } } finish {ambient 2} scale 1/Max_Height translate y * Stem_Speed } #declare stem_mixture_a = texture { #local Burn_Speed = Stem_Speed; // * 2; gradient y texture_map { [0 stem_texture_a] [Burn_Speed - (1 - Burn_Speed) * 1/8 stem_texture_a] [Burn_Speed + (1 - Burn_Speed) * 1/8 fire_texture_b] [Burn_Speed + (1 - Burn_Speed) * 3/8 stem_texture_a] [1 stem_texture_a] } warp {turbulence 1/4 * <1,0,1,>} scale Max_Height } #declare crown_mixture_a = texture { gradient y texture_map { [0 crown_texture_a] [max(Height_Fraction,Smooth_Fraction) - 1/8 crown_texture_a] [max(Height_Fraction,Smooth_Fraction) + 1/8 crown_texture_b] [1 crown_texture_b] } } #declare crown_mixture_b = texture { gradient y texture_map { [0 fire_texture_a] [Fire_Fraction - Crown_Speed - 1/8 fire_texture_a] [Fire_Fraction - Crown_Speed + 1/8 crown_mixture_a] [1 crown_mixture_a] } warp {turbulence 1/4 * <1,0,1,>} scale Max_Height scale } intersection { union { // rotate a 2-D outline of points around the Y axis to create a 3-D shape lathe { cubic_spline // linear_spline | quadratic_spline | cubic_spline 9, // number of points interpolate_spline(06), interpolate_spline(06), interpolate_spline(05), interpolate_spline(04), interpolate_spline(03), interpolate_spline(02), interpolate_spline(01), interpolate_spline(00), interpolate_spline(00) texture {crown_mixture_b} // pigment {color rgb z transmit 1/2} } lathe { cubic_spline // linear_spline | quadratic_spline | cubic_spline 8, // number of points interpolate_spline(11), interpolate_spline(11), interpolate_spline(10), interpolate_spline(09), interpolate_spline(08), interpolate_spline(07), interpolate_spline(06), interpolate_spline(06) texture {stem_mixture_a} // pigment {color rgb x transmit 1/2} } } plane {-y,0} pigment {color rgbt 1} } #local Light_Count = 0; #while (Light_Count < 12) #local Light_Pos = <20,interpolate_spline(8).v,0,>; #local Light_At = <-interpolate_spline(6).u,interpolate_spline(6).v,0,>; #local Light_Col = <248,197,112,>/255 * max((1 - interpolate_spline(06).v/20),0); //#local Light_Col = <100,072,028,>/255; #local Light_Rad = 20 * max((1 - interpolate_spline(06).v/20),0); #local Light_Fal = 40 * max((1 - interpolate_spline(06).v/20),0); // create a point "spotlight" (conical directed) light source light_source { 0 // light's position (translated below) color rgb Light_Col // light's color spotlight // this kind of light source translate Light_Pos // position of light point_at Light_At // direction of spotlight radius Light_Rad // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff Light_Fal // intensity falloff radius (outer, in degrees) rotate y * Light_Count * 360/12 } #local Light_Count = Light_Count + 1; #end /* cylinder { 0,y * Max_Height,20 texture {crown_mixture_b} translate x * 40 } cylinder { 0,y * Max_Height,20 texture {stem_mixture_a} translate x * -40 } #local iCount = 0; #while (iCount < Points_Number) text { ttf "timrom.ttf" str(iCount,0,0) 1/4, 0 pigment {rgb y} scale 4 translate interpolate_spline(iCount) + z } #local iCount = iCount + 1; #end plane { z,0 #local thisfunc = function {pattern {gradient y}} #local newfunc = function {floor(10*thisfunc(x,y,z))/10} pigment { function {newfunc(x,y,z)} color_map {[0 rgb 0][1 rgb 1]} } scale 10 translate z * 40 } plane { y, 0 pigment { color rgbt <0.7,0.5,0.3,0.5> } } */