_______________________   Animated Credits  _________________________________

The Files:
    MakeTextObj.pov: converts 'Test1.txt' into object file 'Test1.inc'
    MakesAnimation.pov : Animates 'Test1.inc'
    Test1.inc    : union of text objects
    Test1.txt    : the text template
    Credits.ini  : Animation Initialization file    
  
 Your first question might be: Why all those files?
   The answer is SPEED! I like Speed! and Flexiblity!
   And don't forget the K.I.S.S.(Keep It Simple Stupid)
  With the help of the POV3.6 win editor I can have all 5 files on screen
 and flip back and forth between them as needed. 

 So What!? 
  Well, in making any animation there's a lot of trial and error and 
 previewing. In setting out to make Credits I thought I'd have two files
 one a TXT file that a POV file would read and make the animation.
 But while testing I asked why should I have to read a file and 
 make the TEXT for every frame.(a question of speed) Also the animation
 part would either need a lot of variables(a question of Simplicty)
 or be lock down to one style(a question of Flexiblity).
  So I went with this four file system. One POV file(MakeTextObj.pov)
 to make a Text object file(Test1.inc) by reading a TXT file(Test1.txt).
 Then a POV file(MakesAnimation.pov) uses the Text object file(Test1.inc)
 to make the animation. I don't know if this qualifies as a good K.I.S.S.,
 but it's pretty fast and very flexibly! 

_______________ The overview of Credits.ini_______________________________

  I set up things so we could used the Credits.ini file to run both
 MakeTextObj.pov and MakesAnimation.pov. 
  MakeTextObj.pov will stop itself after only one frame. When you run it
 if all went well you should get one blank frame rendered. If not 
 hopfully you'll get a debug message telling you the problem. Some times
 when reading a file my version of POV 3.6 will crash after a bad read.
 Missing commas causes it mostly. The crash ain't total so I can shut
 down POV and then restart it.
  MakeTextObj.pov and MakesAnimation.pov should use the same image Hieght
 and image Width. But after the Text object file is made you can change
 the Height and Width to make the final animation. If you do so you need
 to keep the aspect ratio the same. That is the new (Height/Width) 
 equals some number times the old (Height/Width).
  You see MakeTextObj.pov uses the 'image_width' and 'image_height' to 
 calculate the POV values of the screens height & width. It use those
 values with it's functions to place the text. 

    The main thing about Credits.ini is USE IT! 
  I can't go into all the stuff it can do. But I'll touch on a little
 bit. Change things to get a quick animated(full or partial) preview.
 When I got the animation the way I want I shut down everything I can
 for a quicker render.(like no display, no debugs)



_________________Making the Text OBject file______________________ 

  The most complex part is turning the TXT File into a Text object. 
 The Text Object file has a union of text objects. After making the 
 Text Object file you can edit it and animate any way you like. 
 

  The text file has three basic strings types a Control String and a
 Text String and Comment(or header) strings.

 The first THREE strings in the TXT file are comments. You can use 
 them to describe the text, Put your name, time stamp, call your nabor
 a dog, any thing ya want. These strings will be place at the start of 
 the Text Object file as comments. 

 The Text String is simply the text you want on screen. The text is
 centered before the Control words do their thing.

 The Control String tells MakeTextObj.pov how and where to put the text.
 Here are all the control words:

   ___Control Word____Value______Does                           
         LRcontrol = <noValue> Control Flag marks string as a Control 
            Tfont  = <String>   font             
            TScale = <float>    Scale Text              
            TOffX  = <float> x value of Text's Offset           
            TOffY  = <float> y value of Text's Offset           
            Tjust  = <float> text justifycation               
            Tadj   = <float> (adjust y value text's location)
            Lspace = <float> (space's height)                  
            Lborder= <float> (border from x egdes)            
            Llock  = <float> 0=on,1=off  next text on same line
            
 Here's the way a control string is constructed.
  The Control Flag 'LRcontrol' is used only once and has to be the first 
  idem in a Control String.

   An example: "LRcontrol,Tfont,crystal.ttf"

 You'll notice that there are NO SPACES leading or trailing the control
 words between the commas. This is critical as MakeTextObj.pov looks
 for EXACT matches. If the Control Flag 'LRcontrol' has any spaces in it,
 it'll be treated as a regular Text string. If a Control Word has any 
 spaces MakeTextObj.pov will stop and tell you with a debug stament what
 line of the text file cause the trouble.(if you have one string per line).
  You're not limited to one control word per string. You can have many as 
 you want. POV strings are limited to 256 characters,so if you've hit this
 limit(unlikely) you can have two or more Control strings in a row.
  
  example: "LRcontrol,TScale,3,Tfont,crystal.ttf,Tjust,-1",
           "LRcontrol,Lspace,0,Tadj,.1",
           "LRcontrol,Lborder,1",
           "Text string"

  All the Control strings will be apply before "Text string". 

  Before We get down to the functions of each control word, we've got 
 to remember that MakeTextObj.pov has all the default values that the 
 TXT file changes. 
  Here's a list of  MakeTextObj.pov control variables defaults:
         Debug=0              0=no debug 1= light info 2=more info 
         TextFile="Text1.txt" read text file
         ObjFile="Test1A.inc" place text objects
         Style=1;             scroll  0=down 1=up
         TextThick=.4;        float text z start thickness
         TextPlace=-.2;       z direction adjust
       * Font="timrom.ttf"    font
       * TextScale=2;         scale text <value,value,1>
       * TXoff=0;             text Offset= <value,0,0>
       * TYoff=0;             text Offset= <0,value,0>
       * TextJust=0;         -1 left 0 center 1 right
       * TextAdj=0;           pov units move text up/down
       * LineSpace=1;         pov units spaces height
       * LineBorder=1;        pov units from sides
       * LineLock=0;          lock texts to a single line
     * means the text file can change
   
 This means that if you want a fast and clean Credit roll, your TXT file
 can be very simple. See 'Test1.txt'. You could change any the defaults
 in MakeTextObj.pov or you can change then in the TXT file. The main
 difference is that in the TXT file you can change stuff for a single 
 Text Idem or small group of idems. Once you change a Control with the
 TXT file it will act as a default until you change it again.

  There are variables and defaults in MakeTextObj.pov that a TXT file
 wouldn't touch. Of couse the name of the TXT files that is being read,
 the Text Object file name and 'Style'(scroll up or down)are obvious.
  Then there are 'TextThick'(the thickness of the text)and 'TextPlace'
 (the z translate of the text). I left them out of the TXT file for 
 simplicity,(fewer control words). I have them because the normal text 
 object starts at z=0 and goes  in the positive z direction. I wanted 
 to be able to place background plane at z=0 for animation. If you want
 texts of different thickness or moved in and out, you can alway edit 
 the Text object file by hand.
 
  The Control words in the TXT file don't match exactly with the variable
 names in MakeTextObj.pov. I did this because some of the variable names
 are long and I like to keep the TXT files as small as posible and still
 be readable. I know, it's an old habit from my days of the 3.5 floppy 
 and the 256 meg hard drive. There's an converion list at the top of
 MakeTextObj.pov. 

  One more thing before we continue with the Control words. I treat 
 the TXT file as a simple text editing code.(kind of like Html or PDF)
 With the Text object file as a page being writen to. With this in mind
 I've split the Control words into two groups.
   The words that start with 'T' deal with the text stuff.
   While words that start with 'L' deal with Line stuff.
 
  Now on to the Control words!
  
 Control Words that start with 'L' deal with Line stuff.
 (there's only 3 Lspace, Lborder, Lock)  
    Lspace: controls how tall a blank line is.
            a blank line is any text string that is empty or is
            filled with spaces."" & "      " are considered blank lines
   Lborder: controls the margins of the sides 
            the Value is in POV units and used use for both sides
      Lock: This tells MakeTextObj.pov that the next Text String
            will be placed on the curent line. This used with
            'Tjust'and some font change can make neat line of text   
            Be sure to turn if off when done or all the following text 
            will be on one line.

 Control Words that start with 'T' deal with Text stuff.
      Tfont : changes font 
              POV comes three TTF fonts timrom.ttf,cyrvetic.ttf,crystal.
              I've use only these in the examples. You'll definetly need
              to have in Credits.ini a Library_Path set to where you 
              keep your fonts.
      TScale: Scale Text 
              this one value scales in both the y and x direction. If 
              the text is scaled beyound the borders then MakeTextObj.pov 
              will adjust the scale for that text only to fit the screen.           
      TOffX : x value of Text's Offset         
      TOffY : y value of Text's Offset
              these two values make up the vector that POVs text object
              use for letter placement and spaces between letters
      Tadj: adjust y value text's location
              It's value can be use instead of puting a Blank line
              between each text if positive or crowd two lines of text
              togather if negative.     
      Tjust : text justifycation
              This is the fun one I started with only three values
              -1,0,1 far left border,center,far right border. 
              But with the addition of 'Lock' I wanted more control 
              over side placement of the text. So if you use -1 it 
              stills take you far left, but you can use -2 which will
              put the text 1 pov unit to the RIGHT far left. You can 
              keep on going with -3,-4,-5 until your off the screen!
              And you don't have to use integers, float point values
              works just fine.The Right side works the same way.

 There are all the Control Words. 
 

____________________Text Object File______________________________________

   Now on to the Text Object File.(made by MakeTextObj.pov)
 The Text Object File will have 4 comment Lines,an union of 'text' objects.
 and a declared variable name 'Text_End'.
 
  The first 3 Comments come streight from the TXT file use to make this 
  file. With one Comment added either "Scroll Up' or 'Scroll Down'. This
  was added to help you animate. When MakeTextObj.pov makes a union of
  'text' objects the Scroll value('Style') determines the direction(-y,+y)
  of the next 'text' objects placement.
  
  In the union, the first line of text will centered at <0,0,0>. Unless 
  you have used some controls to change it.
  'Text_End' is the last line of text center y value.
  
  An example of a 'text' object:
  
  text{ttf "crystal.ttf" "Line8" 0.4,0 //normal POV text stuff
    translate <-1.22412,-0.361585,-0.2> //center text
    scale <1.5,1.5,1>                   //scale text
    translate -y*10.7907                //place text
    }

  Well that's it for the Text Object File. Once you have it you can play
 with it to your hearts desire.
 
 
________________________ Animation ______________________________________  \

   MakesAnimation.pov is what it does. This little peace of code will
  take an Text Object File(Test1.inc) and produces an animation. I've 
  set it up so that you can have an another animation running behind 
  the Credits as a kind of background. It uses the still frames of an 
  all ready made animation.(Tga only)
   It also has lets you adjust the placement and texture of the 
  union of 'text'.
  
  I was hoping I could use MakesAnimation.pov as a master file to
  handle any animation you would need. Here is where I ran into a 
  problem. There are two main ways I considered to do the animation, 
  I could use lights or I could use a finish with a High ambient 
  value. Both have their advantages. Lights give a solid looking text
  and you could use normals. While the finish is quick, gives a flat 
  look and don't do normals.
   I did my best to give you both with the minimal values to change.
  Other than that there are some things you may want to do that 
  MakesAnimation.pov can't handle. You'll have to write you own 
  POV code to for that.
  
   Now on with the MakesAnimation.pov variables!
   
       Debug= 0    0=no debug 1=Main 2=background animation image only
       Fps= 24     frames per second for use in Debug=1
       Text= #include"Test2.inc" Text Object file
       Start_Offset=0;  move text object +toward top -toward bottom
       End_Offset=0;    stop offset      +toward top -toward bottom
      
       Background_image=""; if "" no background else background image
       Background_Animation=1;//yes no
       Background_Ambient=.1;  ambient value Background
      
       Text_Material= Pov material for union of text objects
       
    MakesAnimation.pov will determine the scroll direction based
   on the union in the Text Object file. 
    I set up 'Debug' to offer you a little help to set the 'Start_Offset'
   and 'End_Offset'. When you have 'Debug' set to 1 you'll get a list
   of values. If you have the 'Start_Offset' set to 0, you'll get 2 
   estimates, one for the last text ending in the center and one to take
   the last test off the screen. With 'End_Offset' set you can the deside
   where you want to start by setting 'Start_Offset'. With 'Debug' set 
   to 2 you'll get the background image information only.
   
    
    
   
   
     
  