in.table is the file that will be used to animate the vehicle itself. By default, it is assumed that it contains a time column, three columns of translation information, and three columns specifying the vehicle's yaw, pitch, and roll. If it is desired that the vehicle be steered automatically, then the table should contain only time and position, and the -s option should be used.
The track's geometry is defined by wheelfile, a table which contains one row for each wheel defining the track. The first three columns of the table specify the x, y, and z coordinates of the wheel centers. The fourth column specifies the radius of each wheel.
The order in which the wheels are listed should be the order in which a link of the track would move around the wheels when the vehicle is moving forward. (clockwise, when looking from the right of the vehicle). The wheel centers should all lie in a plane perpendicular to the vehicle's left-right axis. If this is not the case, anim_hardtrack uses the first wheel as the standard and projects all the other wheels into the same plane as the first wheel. By default, it is assumed that the vehicle's left-right axis is the y-axis. If the modeled vehicle has some other orientation, this must be specified with the -b option.
By default, it is assumed that all of the link objects are modeled at the model origin, with the wheel-contacting surface centered on the origin and the ground-contacting surface facing up. The sides of each link which connect to other links should face the positive and negative x-axes. Anim_hardtrack prints the appropriate commands to move the links from the origin to the correct place around the wheels.
If the links are modeled in place around the wheels to begin with, the the -p and -i options are needed.
OPTIONS:One or both of the first two options should always be specified.
When calling anim_script to handle the animation of the vehicle itself, the parameters following the -b and -d options should be identical to those used for anim_hardtrack.
The output is a script containing as many frames as there are positions in in.table. If there are n links and k wheels, each frame contains up to n+k anim commands, either:
anim linkname.i matrix lmul [... matrix ...] ; or anim wheelname.j matrix lmul [... matrix ...] ; for 0<=i<n and 0<=j<k.
anim_script -s -d 0 0 1000 -b 90 0 0 /tank < in.table > tank.script
Suppose that there are two roadwheels and a drivewheel (tank/rwheel/wheel.i, 0<=i<3) which define the shape of the right track. A file called rwheelfile is created:
1500 -2000 30 30 1500 0 1000 35 1500 2000 30 30This rwheelfile lists the position and radius of each of the three wheels.
There are eighty links which make up the right track (tank/rtrack/link.i, 0<=i<80). The links of the right track are all modeled at the origin with the outer, ground-contacting surface facing up and the inner, wheel-contacting surface centered at the origin.
The appropriate call to anim_hardtrack is now:
anim_hardtrack -d 0 0 1000 -b 90 0 0 -w tank/rwheel -l 80 tank/rtrack/link rwheelfile < in.table > rtrack.script
Suppose that the left track is similar to the right track, except that all the wheels are of radius 30 units, and the links, rather than being stored at the origin, are actually placed in position around the left wheels to begin with. The lwheelfile would be:
0 30 -1500 0 1000 -1500 2000 30and the call would be:
anim_hardtrack -p -r 30 -d 0 0 1000 -b 90 0 0 -w tank/lwheel -l 80 tank/ltrack/link lwheelfile <in.table > ltrack.script
Here, it is assumed that tank/ltrack/link.0 is initially at the beginning of the straight track segment between lwheel.2 and lwheel.0, that is, at the point (2000,1500,-1000) in the vehicle's coordinates. If, instead, the first link is initially centered halfway between the two roadwheels, this must be specified with the -i# option. If the link's actual position is 2000 units farther around the track than expected:
anim_hardtrack -i 2000 -p -r 30 -d 0 0 1000 -b 90 0 0 -w tank/lwheel -l 80 tank/ltrack/link lwheelfile <in.table > ltrack.script
One final step may remain. The above procedure produces a script with rigid naming conventions, in order to make input simple. This may mean that the names in the script do not match the names in model.g. An editor should then be used at the end to replace all instances of the conventional name with the real name; for example, in this case it may be necessary to replace "rwheel.1" with "r_drivewheel".
Tank.script, rtrack.script, and ltrack.script can be combined with anim_sort to make the complete script.