3 easy steps to an animation in POV-Ray
© and written by GRUMET Lukas | http://www.thespacebetweenus.com
|
camera { location <3, 3,3> look_at <0,0,0> } |
For an animation, you always need a clock variable. It is "the key
to it all", say the authors of the online
documentation on povray.org.
The clock variable can be inserted for example in the "translate"
or on in the "rotate" tag.
At first, we will try to rotate the box, so therefore we will add the
clock variable to the "rotate" tag, which would look like this:
| camera { location <3, 3,3> look_at <0,0,0> }
|
As you can see, i added the "rotate" tag to the box, and in
it's coordinates, I inserted the clock variable. This means the box rotates
-360°(replace the - through a +, then it will rotate in the opposite
direction) around the X-axis and 0° around the y- and z-axis (if you
want it to rotate around an other axis, just insert the variable in the
axis-value you want it to rotate).
Ok. Don't push the "Run-Button" yet, because you won't get anything
special. Save your file as "stepstoanimation.pov".
Create a new file and save it as: "animation.ini" and please
save it into the same folder where you have put in your .pov file
Well done, so far;We are nearly finished.
At first we have to tell the ini file, which file it should raytrace
when it is finished. This is done by the following code:
|
Input_File_Name=stepstoanimation.pov |
Our input-file-name is our "stepstoanimation.pov" of course.
Right, now we just have to tell the ini file where the clock should start
and how much frames it renders:
|
Initial_Frame = 1 |
Initial_Frame tells the ini file where(on which frame) it should start
to ray trace.
Final_Frame says where to end the animation. So, this is the number of
frames you can adjust.
Initial_Clock defines where the clock starts.
Final_Clock defines where to end the clock. For example: If you set it's
value t0 2.0, the box will rotate 2 times.
Once again, the full source code of the ini file:
| Input_File_Name=stepstoanimation.pov |

Now press the "RUN" button!
Have a look at your folder where you have saved your .pov file. Now, there
should be all the frames-Now, add them together with a program like Image
Ready, or something else.
Congratulations! Now you should have understand the basics of an animation. Read on, if you want to know how the motion works. Play around with the values above, i hope you will get what you want.
Ok, we keep our source code as it is, BUT we remove the rotate tag and expand the "translation" tag a bit.
| camera { location <3, 3,3> look_at <0,0,0> }
|
As you can see we have got 2 "translate" tags in the code.
The first one tells POV-Ray where to start, the second one, where to end.
You need "pi" and "pi*clock".
Save this file as "stepstoanimation-translate.pov", then switch
back to our .ini file and change the input settins to our new "stepstoanimation-translate.pov"
file.
Then you should get something like this:
You can also mix the "rotate" and "translate" tag; below is an example:
| camera { location <3, 3,3> look_at <0,0,0> }
|
That's all folks. These are the most common animation tags in POV-Ray.
I hope this tutorial could help you, and if you have got any more questions,
feel free to mail me.
You can grab the zip file containing the POV files and the INI file here
your pal
-mas