Anim System Tutorial

Covered in this tutorial.

  1. Overview of files
  2. Detail usage of files
  3. Example Anim


ini.ini Main ini file template
Main.pov Main anim pov file
Lastval.inc Holds last values
Startval.inc Holds a set of start values
inertia/Convel.inc Converts velocity
inertia/Inertia.inc does the movement calculations
Anim/Objects.inc Holds a list of objects to be animated
Anim/Moveobj.inc Template for the controls to move an object
Anims/Makeflc.bat Batch file to create a flc using DTA
Anims/Joinflc.bat Batch file to join a flc using DTA


Details

ini file

Things that have to be set

Final_Frame The number of frames in the total animation. This is calculated by - Anim length in secs* Frames per sec
Subset_Start_Frame For starting the rendering of an animation later through
Subset_End_Frame For ending the rendering early

Main.pov

MainScene The name of your main scene
secs Length of animation in seconds. - Must be a whole number of frames. eg

if anim to be around 25secs, and there are 16.67 frames/sec (1 frame every 3/50 of a second) then,

25*50 (number of points to be calculated) = 1250.

1250/3 (number of frames) = 416.66667 -> round to 417 frames

417*3 (number of points to be calculated) = 1251

1251/50 (length of animation) = 25.02secs

Frames Number of frames per sec. Must divide evently into the res value. ie Frames can equal Res/1, 2,3,4,5 etc

eg.

Res/n Frames/sec
1 50
2 25
3 16.67
4 12.5
5 10
fast Use in your scene file to block out unnecessary detail.
res The resolution of the calculations
Often How often to save the object positions to a file for cacheing. ie if Often=20 then save every 20 calculations, so that it doesn't have to be recalculated
flight Turn on flight path checking. Please use a #if(flight=off) ....... #end around your camera statement
ObjectPos Set to the position var for your object. eg ObjectPos=Ship1Pos
Marker How often to place a red marker in the flight path.

Also a green marker is placed at 10x marker. This value is how many calculations between each marker. If you make this value the same as the res value then you will get a red marker at 1 sec and a green at 10 sec intervals.

Jumpin To let the calculations jump in part way through the animation. eg.

    calculate to a point eg 10 secs time

    copy the section from lastval.inc for Time=9.20 and paste to Startval.inc

    Set Jumpin to true. Now the Startval.inc will be read and the calculations will go from that point.


Objects.inc

#include "Anim/your_object_movement_file.inc"

Can use the Time var to remove sections.

eg.

and in your scene file


Moveobj.inc

Vars for the inertia system.

@obj@ is replaced with the name of you object.

@obj@Inertia If to use inertial or non-inertial movement.

Inertial is the correct method as far as the equations of motion go, and is great for in space.

Non-Inertial looks good for atmosphere movement, ie where friction has a part in the movement.

@obj@Dir Only used when inertia = true. Locks the direction of the acceleration to the rotation of the object.
@obj@Acc <heading,pitch,size>. The Acceleration of the object. If in non-inertial mode then only the size part is used.
@obj@Vel <heading,pitch,size>. The object's velocitiy. If using non-inertial mode then only the size compent is used.
@obj@Pos <x,y,z>. The position of the object. To use in your scene -> object {thing translate thing.Pos}
@obj@Rot <bank,heading,pitch>. The rotations of the object. To use in your scene -> object {thing rotate thingRot*<1,0,1> rotate thingRot*<0,1,0> translate thingPos}
@obj@Rotch <bank/sec,heading/sec,pitch/sec>. The changes in rotation in degrees per sec.

For inertial movement I find the I only change the bank, and pitch and set the heading to = -thingRot.x. Ie the objects current bank.


AnimSystem Tutorial.

In this tutorial we will go from nothing to a simple and object and camera flying around a small landscape.

1) Now the AnimSystem expects.


Design the Objects

Object 1.


3) Now to create the Animation


Now you can see a white line with green and red blobs. The bottom most green blob is the Time=0, iw the start. Each Red blob from there is at 1 sec intervals with the last green blob for Time=10. At Time=6 the plane has reached the top of the curve so at that point we will flatten out the wings and start a turn to the right.

Now Render again.

Now you can see from the flight path that the plane didn't immediately turn right. This is because it is already turning left and the plane has to first level out and then turn to the right.

Also at Time=10, the plane is heading for a block so to change this lets change the #range(6,10) section to read;

Now if we render again right from the start then it will again take ~ 1 min to render (on a 486x100). But if you look at the flight path you will notice that the values for a time <6 haven''t changed, and in the Lastval.inc is a set of values that specify a time close to 6.

So open up the Lastval.inc file. Go down the file until Time = just less than 6.00. I get 5.60. Take the values for the Tme=5.60 and copy to a new file called Startval.inc in the same directory as tutanim.ini.

The lines copied should be;

Edit the file Main.pov and set Jumpin = true

Now render. This time it took me ~30 secs.

This gets us round but the plane looks like it might go a biut close to the top block. So lets change the

Re-render to see what that looks like.

Now I have worked out the rotations needed all the way up 10 secs. They are;

This looks like;

The rest of the animation for an object is just a collection of what has already been done.

Here are the rest for plane.inc

Now as the motion is now defined up to time 25 , edit Main.pov and change secs=25

Change the Jumpin=false to render to whole path.

And now to define the camera.


Now to finally have a look from the camera's point of view of the animation.

1.



That is how to create an animation using the Anim System. Have a look at the Shipanim and Shark examples also, to see how they work.

Fran.

1