POV-Ray : Newsgroups : povray.newusers : Animation Tutorial for New Users Server Time
14 Nov 2024 14:17:55 EST (-0500)
  Animation Tutorial for New Users (Message 1 to 1 of 1)  
From: K  Tyler
Subject: Animation Tutorial for New Users
Date: 31 Aug 1998 04:01:56
Message: <35EA49F0.564D218E@pacbell.net>
8-30-1998

A POV-Ray 3.0 Animation Tutorial

Greetings !

Many people post questions on the news groups asking how
to use POV-Ray to produce animations. Also mentioned is
confusion about using the clock values and finding the info
needed in the POV-Ray on line help system.The pupose of this
mini-tutorial is to help you get started. It will NOT on the
other hand explain every possible option nor will it turn you
into a master over night. It is simply an attempt on my part
to help you get a feel for the process and get your first animation
project done with as little problems as possible.

So lets get started OK !

Using POV-Ray to produce the images for the animation:
---------------------------------------

Lets create an object to animate:

camera{location<0,0,-4>look_at 0}
light_source{<0,0,-50>rgb 1}

sphere{<0,0,0>,1 pigment{gradient x
color_map{[0 rgb<1,0,0>][1 rgb 1]}}
finish{ambient .4 diffuse .1 reflection .1 specular 1 roughness .001}
rotate 360*y*clock}

    The above won't do anything during a single frame render.
All this will produce is one sphere on the screen. Not very usefull
for an animation is it ?

    First let me explain a couple things. To produce an animation
you will need to produce several images, just like cartoon
animators do. Secondly you will need a program, external to
POV-Ray to compile the multiple images produced into an
animation. A command line animation program called DTA or
Dave's Targa Animator does a great job. If you don't have
it and can't find it post a message to the povray animation news
group and somebody will tell you where to get a copy. It produces
.fli .flc and a couple other animation types. There are other programs
you can use but I think DTA is a good one to start with.

    Now for the specifics of making the frames you need.
The following describes how to rotate your sphere once
in a 360 degree circle.
    You could change rotate 360*y*clock to 720*y*clock
to make it rotate twice or any other multiple of 360 you
choose to use.

    On your menu bar find the tools section and click on
edit master povray.ini. Add the following lines anywhere
in the ini file, save and exit.

;Initial_Frame = 1
;Final_Frame   = 100
;Subset_Start_Frame = 50
;Subset_End_Frame = 100
;Cyclic_Animation = on

To use these settings you need to un-comment the functions you
want to use by removing the ";".

To produce a simple continuous animation start with these settings:

Uncomment these:
  Initial_Frame      = 1
  Final_Frame       = 10
 Cyclic_Animation = on

Leave these commented out:
;Subset_Start_Frame = 50
;Subset_End_Frame = 100


    This will produce a 10 frame animation.

    The initial frame tells Pov you want to start with frame #1

    The final frame tells Pov how many frames (images) you want
to produce. The more you specify the smoother the animation
but the larger the animation file size. You will later learn how
to balance the # vs. file size as you gain experiance.

    The use cyclic animation tells Pov you want it to produce
an animation that will loop continuously. If your animation
had an object moving in a straight line this would be of no use
to you. Since we are looking at an object that is going to turn
360 degrees on it's axis this is a perfect example of when to use
it.

    The other two settings can be used to render only a
portion of the frames that make up an animation. Say
you wanted only to look at the end of your scene,
before rendering 1000 frames, to make sure everything
ends up where it is supposed to. This will allow you to
do so. It is not normally needed however.

    There are many other examples in the docs and I
strongly recommend you read the section on using
the clock values in your scenes and the section 4
tutorial on animation. Also section 3 on using .ini files
but more on that later.

    Don't forget to re-comment the animation lines in the
master povray.ini when you are not doing animation
or else the next non animation scene you try to run
will run the exact same image for however many frames
you have specified in the final frames section.

Making the Animation File
-----------------------------

    Take a look in the POV-Ray docs under section 3 which
describes the use of .ini files with POV-Ray. Then in one of
your POV-Ray subdirectories you find an .ini file called tgafli.ini.

    This was written by those incredible members of the pov team
that seem to somehow think of everything. When activated this
.ini file will allow you to render however many frames you specified
in the final frames section, then it will automatically call DTA,
and compile your animation for you using DTA.

    You can edit this file to change the final animation size, resolution,
and type. Using the format of this .ini file you can use it as a foot print
to call other animation packages to compile your rendered frames.

    You will probasbly ask about other animation packages and there
are several available. One I'm falling in love with is a shareware
package called Main Actor. It is Win 95 friendly.
The URL for this is http://www.mainconcept.de
Another favorite of many people is called Video For DOS
or "VFD". It is of course another dos based program. Also search
for a program called "Smacker". It is said to be great for converting
between different image file types and I believe has some animation
ability. I have no experiance with Smacker and cannot vouch for it.

Using DTA
------------

   Here are a few parameters and an explanation of their use to pass
to the DTA program.

    Let's assume you have named you animation test.pov.
Use the sphere example above. You have told POV-Ray to render
10 frames for this animation. You wait until POV-Ray has finished
rendering these ten frames.

    Somewhere on your drive you now have ten .tga files.
They will be listed as test001.tga, test002.tga, test003.tga ... etc.
Pov automatically adds the extra three digits for you as it renders
each one.

    Copy or move them to where you have DTA installed if it is
different from where the tga files are located.

Go to that directory and type the following at a dos prompt:

dta test*. /otest

This tells DTA to take all tga files in this directory called test
and to produce an animation called test.fli



dta test*. /a1 /otest

This tells DTA to take all tga files in this directory starting with test,
take the average between 1 frames (read the dta docs for more info)
and then produce an animation called test.fli. Average is a nice option
for creating motion blur : )



dta test*. /x2 /otest

Same as above but instead expands each frame by looking at
the objects position in the image and the position in the frames
before and after the frame it's working on (again the dta docs
can explain it better than I can).
    Your original 10 frames are now expanded to 20 (30 ?) frames.
This function can help smooth out the gaps between images in
your animation. This also can be a powerful feature. Use this
when doing test renderings for your animations. Ten frames
is usually considered too low a number to get a good animation.
But if you just want a quick preview, render ten quick frames,
use the expand command and it will do a good job of showing
you what your animation would look like if you rendered many
more frames.



dta test*. /s200  /otest

This tells DTA to take all tga files in this directory called test
and slow down the playback of your animation to a speed of
200 milliseconds ? per frame (I'm not sure how this is implemented
but it works).
You will find on many of the shorter animations that you try to
produce they seem to play back way to fast to be useful. Use this
command to slow your animation down. A range of /s50 to /s300
is a good place to start until you understand the option.


Other Utilities for Animations
---------------------------------

There are also many other utilities that have been written by other
POV-Ray users that help in making your animations more realistic.
These range from object placement tools, generating camera paths,
animating water fountains, generating exploding objects (the famous
Chris Colefax Plug in .inc files), and a bunch of other utilities too
numerous to list here. A couple great sources of information for
finding these pograms are the comp.graphics.rendering.raytracing FAQ
which is posted once every 10 days on that news group and also check
out the POV-Ray ftp site. They have available ready for download an
incredible amount of utilities at their site. ftp://povray.org .

----------------------

    Well that about sucks me dry for information on animations and
using DTA. If I seem to have missed something let me know and
I'll see if I can fill in the blanks. In many ways I too am a beginner
when it comes to animations so don't ask me how to do animations
of humans walking down a flight of stairs because I can't do it.


I can be reached at: tyl### [at] pacbellnet

Happy raytracing and enjoy your new found skills.

K.Tyler


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.