/* Persistence of Vision Ray Tracer Scene Description File File: Walltest.pov Vers: 3.5 Desc: failed IRTC particle sparks animation Date: 020403 Auth: Mark James Lewin Notes: The sparks seen in the animation posted to p.b.a were generated with my (as yet unreleased) particle system. These have not been included, but notes on them are found at the end of the code. The animation was designed for 25 frames per second. */ #version 3.5; #include "colors.inc" #include "textures.inc" #include "transforms.inc" #default {finish{ambient 0}} global_settings { max_trace_level 100 assumed_gamma 1 } camera { location <0,125,-250> direction <0,0,1> up <0,1,0> right <4/3,0,0> look_at <0,30,0> angle 67.38 } #declare C = 0; #while (C<3) // just some fill lights light_source { <0,150,100> colour rgb <1,1,1>*(1-(C/3))*0.333 rotate <0,120+(120*C),0> } #declare C = C + 1; #end // Macros #macro Spline_Sweep(Spline,Spline_Points,End_Value,Radius) /* Spline (from 0 - 1) Spline_Points End_Value Radius Creates a sphere_sweep from a spline */ sphere_sweep { linear_spline #local N=floor(End_Value*(Spline_Points-1))+2; N #local I=0; #while(I+Spline(I/(Spline_Points-1)),Radius #local I=I+1; #end <0,0,0>+Spline(End_Value),Radius } #end // Variables #switch(frame_number) #case(0) #declare TW1_Base_Cut = 0.2; // Decides how far the cut in the wall has gone // Modify this value for static (test) renders #break #range(1,100) #declare TW1_Base_Cut = frame_number/100; // cut finishes after 100 frames #break #else #declare TW1_Base_Cut = 1; #end #declare Cut_Spline = // The spline that defines the cut path. spline { cubic_spline #local N=17; -1/N,<85,45,0> 0/N,<75,40,0> 1/N,<63,35,0> 2/N,<50,44,0> 3/N,<34,56,0> 4/N,<22,53,0> 5/N,<7,45,0> 6/N,<-3,32,0> 7/N,<-20,33,0> 8/N,<-28,30,0> 9/N,<-38,25,0> 10/N,<-41,30,0> 11/N,<-40,44,0> 12/N,<-30,51,0> 13/N,<-37,64,0> 14/N,<-55,63,0> 15/N,<-62,50,0> 16/N,<-76,46,0> 17/N,<-100,45,0> 18/N,<-110,45,0> } // Wall parts #declare TW1_Base = intersection { box { <-100,15,-15> <100,75,15> } height_field { function 1.5*200,1.5*80 { pattern { pigment_pattern { pigment_pattern { // average lots of spline_sweeps to create a gradiated pattern average pigment_map { #local I=0; #while(I<40) [ 1 object { Spline_Sweep(Cut_Spline,18,TW1_Base_Cut,I/3) rgb 0 rgb 1 } ] #local I=I+1; #end } } pigment_map { #local I=0; #while(I<20) [ I/19 wrinkles // creates the bumoy look scale 3 colour_map { [0 rgb 0.5] [I/9 rgb 1] } ] #local I=I+1; #end } translate <100,-15,0> scale <1/200,1/60,1> } } } rotate <-90,0,0> scale <200,-60,30> translate <-100,60+15,15> scale 1.001 } texture { pigment { rgb 1 }} // the base texture texture // add a burnt texture. Based on the same pattern that defines the cut. { pigment { pigment_pattern { average pigment_map { #local I=0; #while(I<40) [ 1 object { Spline_Sweep(Cut_Spline,18,TW1_Base_Cut,I/1.75) rgb 0 rgb 1 } ] #local I=I+1; #end } } pigment_map { #local I=0; #while(I<20) [ I/19 wrinkles scale 3 colour_map { [0 rgbt <0.1,0.1,0.1,0>] [I/9 rgbt <0.1,0.1,0.1,1>] } ] #local I=I+1; #end } translate <0,0,-15> } finish { diffuse 0.8 } } } #declare TW1_Stand = union { box { <-102.5,10,-17.5> <102.5,15,17.5> } cylinder { <-100,0,-15> <-100,10,-15> 2.5 } cylinder { <-100,0,-15> <-100,2.5,-15> 7.5 } cylinder { <100,0,-15> <100,10,-15> 2.5 } cylinder { <100,0,-15> <100,2.5,-15> 7.5 } cylinder { <-100,0,15> <-100,10,15> 2.5 } cylinder { <-100,0,15> <-100,2.5,15> 7.5 } cylinder { <100,0,15> <100,10,15> 2.5 } cylinder { <100,0,15> <100,2.5,15> 7.5 } cylinder { <0,0,-15> <0,10,-15> 2.5 } cylinder { <0,0,-15> <0,2.5,-15> 7.5 } cylinder { <0,0,15> <0,10,15> 2.5 } cylinder { <0,0,15> <0,2.5,15> 7.5 } texture { Chrome_Metal } } union { object { TW1_Base } object { TW1_Stand } } // Floor plane { y 0 texture { pigment { rgb 1 }} } // Big Spark #switch(frame_number) #range(0,100) union { #local TS0 = seed(clock*10000); #local TSN = -1+2*rand(TS0); #local TSM = select(TSN,-1,1,1)*(0.25+(0.5*rand(TS0))); sphere { <0,0,0> 2 hollow on texture { pigment { rgbt <1,1,1,1> }} interior { media { intervals 1 samples 5,50 confidence 0.95 variance 0.05 method 3 emission <1,0.75,0.5>*(0.5+(TSN*0.1)) absorption <0,0.25,0.5>*(0.25+(TSN*0.05)) density { spherical turbulence TSM colour_map { [0 rgb 0] [1 rgb 1] } } } } scale 23 } light_source { <0,0,-1.5> rgb <1,0.75,0.5>*(10+(TSN*3)) fade_distance 15 fade_power 2 } translate <0,0,-16>+Cut_Spline(TW1_Base_Cut) // place just off the wall, in the cut path } #break #end // Particles /* Add your particles here. Generate them at <0,0,-15>+Cut_Spline(TW1_Base_Cut). The particles in the animation died after ~ 0.5s. The fading was controlled with the variable Age_Strength. My particles looked something like this... sphere { <0,0,0> 1 hollow on texture { pigment { rgbt 1 }} interior { media { intervals 1 samples 5,50 confidence 0.95 variance 0.05 emission <1,0.75,0.5>*1*Age_Strength absorption <0,0.25,0.5>*0.5*Age_Strength density { spherical poly_wave 2 colour_map {[0 rgb 0][1 rgb 1]} } } } scale 2*<1,vlength(Velocity)/20,1> // typically b/w <1,10,1> and <1,20,1> Point_At_Trans(vnormalize(Velocity)) translate Position } */