// File: .pov // Vers: 3.6 // Desc: A caption macro // Date: 02-07-06 // Auth: Greg M. Johnson // // must have pre-defined: a variable cameratransform to be used in transform{cameratransform} // inputs: start time in seconds, end time in seconds, clock, totalseconds of anim, // and text declares for up to three lines of captions. #macro captionmacro(starty,endy,clocky,totalsecs,captline1,captline2,captline3) #declare localcaptline1=captline1 #declare localcaptline2=captline2 #declare localcaptline3="a" #declare localcaptline3=captline3 #declare localcaptline1obj=text { ttf "COMICBD.ttf" localcaptline1 1,0 pigment{rgb 0}} #declare localcaptline2obj=text { ttf "COMICBD.ttf" localcaptline2 1,0 pigment{rgb 0}} // Persistence of Vision Ray Tracer Scene Description File #ifdef(localcaptline3) #declare localcaptline3obj=text { ttf "COMICBD.ttf" localcaptline3 1,0 pigment{rgb 0}} #end #declare l1drop=-y*(max_extent(localcaptline1obj).y-min_extent(localcaptline1obj).y); #declare l2drop=l1drop-y*(0.33+ max_extent(localcaptline2obj).y-min_extent(localcaptline2obj).y); #if (strlen(localcaptline3)>1) //#ifdef(localcaptline3) #declare l3drop=l2drop-y*(0.33+ max_extent(localcaptline3obj).y-min_extent(localcaptline3obj).y); #end //#ifdef(localcaptline3) #if (strlen(localcaptline3)>1) #declare text1=union{ object{localcaptline1obj translate l1drop} object{localcaptline2obj translate l2drop} object{localcaptline3obj translate l3drop} } //#debug "\n\n\n\n\n said def!\n\n\n\n" #else //#debug "\n\n\n\n\n said no def!\n\n\n\n" #declare text1= union{ object{localcaptline1obj translate l1drop} object{localcaptline2obj translate l2drop} } #end #declare this_transform= transform{ translate -x*(max_extent(text1).x-min_extent(text1).x) scale 0.05 //translate <0,0,0.412>+0.4*<320/240,1,0> translate <.55,.407,0.412>} #declare localsigny= //caption 1 // (starty,endy,clocky,totalsecs,localcaptline1,localcaptline2,localcaptline3) spline { linear_spline //cubic_spline -20.00/totalsecs, <0,.450,0>, starty/totalsecs-0/24/60/totalsecs,<0,.250,0>, //-0/1440 starty/totalsecs+5/24/60/totalsecs,<0,0,0>, endy/totalsecs-12/24/60/totalsecs,<0,0,0>, endy/totalsecs-8/24/60/totalsecs,<0,-0.01,0>, endy/totalsecs-0/24/60/totalsecs,<0,0.25,0>, 1,<0,0.45,0>} //#declare thewholecaption= union{ object{text1} box{min_extent(text1)-0.33,max_extent(text1)+0.33 scale <1,1,0.02> translate 0.1*z pigment{rgb 1} finish{ambient 1}} difference{ box{min_extent(text1)-0.45,max_extent(text1)+0.45 scale <1,1,0.02> pigment{rgb 0}} box{min_extent(text1)-0.33,max_extent(text1)+0.33 scale <1,1,2.00> pigment{rgb 0}} //pigment{rgb 0} } transform{this_transform} translate localsigny(clocky) transform{cameratransform} no_shadow } #end //#include "lab.pov" object{lab} //media { scattering { 1, rgb 0.03} intervals 1 samples 5 method 3}