ANIM_HARDTRACK
nged
BRL-CAD
BRL-CAD User Commands

# anim_hardtrack

make an animation script for the links and/or wheels of a tracked vehicle with rigid axles.

          anim_hardtrack
          -l num_linkslinkname
          -w wheelname
          options
          wheelfile
          in.table
          out.script

## DESCRIPTION

Anim_hardtrack is designed to produce an animation script for the animation of a track and/or the wheels defining a track, where the wheels are rigidly fixed in place with respect to the vehicle. The main difference between `anim_hardtrack` and anim_track is that anim_track handles vehicles with dynamic axles. Both are designed to be used in conjunction with anim_script, to achieve the final result.

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 `-p` and `-i` options are needed.

## OPTIONS:

One or both of the first two options should always be specified.

`-l num linkname`

  Print animation scripts to animate the links of the track. Animation commands will be printed for num different links named linkname.0, linkname.1, up through linkname.(num-1). A typical example of a linkname might be "tank/righttrack/links/link." The full pathname must be specified, because `anim_hardtrack`'s method is to roll the links around within the vehicle's tree structure so that when the whole vehicle "tank" is animated, the complete combination of rolling around and translating is achieved.

`-w wheelname`

  Print animation scripts to rotate each wheel. The wheels are named wheelname.0, wheelname.1, and so on, where wheelname.0 is the first wheel listed in wheelfile. As with the links, the full pathname for the wheels should be specified.

`-b # # #`

  Specify the yaw, pitch, and roll of the vehicle's axes with respect to the world axes. By default, the vehicle is assumed to have a yaw, pitch, and roll of 0.

`-d # # #`

  Specify (in world coordinates) the centroid of the vehicle of which the track is a part. By default, the vehicle is assumed centered at the origin.

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`.

`-r #`

  Specify the common radius of all wheels. In this case, the fourth column should be omitted from the wheelfile.

`-s`

  Automatic steering. In this case, in.table specifies only the time and position of the vehicle. The orientation is calculated to always face the vehicle in the direction of motion. This should be used when the `-s` option is used by anim_script to animate the vehicle.

`-f#`

  Specify the integer with which to begin numbering frames. Default is zero.

`-p`

  Animate placed links, rather than links stored at the origin. In order for placed links to be animated, they must be equally spaced around the wheels defining the track. The track must be formed of arcs around the wheels and straight lines between the wheels, and the links must be numbered clockwise as seen from the right. By default, it is assumed that the center of the first link, linkname.0, is at the beginning of the straight track segment between wheel.(n-1) and wheel.0. If this is not the case, the position of the first link must be identified with the `-i#` option.

`-i#`

  Specify the initial offset of the first link. If this option is not used, the initial position of linkname.0 is assumed to be the beginning of the straight track segment between wheel.(n-1) and wheel.0. If it is used, the argument specifies the distance clockwise around the track from the default position to the actual desired offset. If the links are modeled at the origin, the user can choose any offset. This can be useful for lining up the links with gears of a drive wheel, for example. If the `-p` option is being used to animate preplaced links, then it is essential that the actual offset of the first preplaced link be specified.

`-g#`

  Return "arced" for mged instead of "anim" for rt.

`-ml<string>`

  Use <string> for the link command. Defaults to "rarc."

`-mw<string>`

  Use <string> for the wheel command. Defaults to "lmul."

`-c`

  Only output the circumference of the track.

### Output:

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.

## EXAMPLES

Suppose you want to make an animation of a tank rolling across flat ground. A list of desired positions is created, perhaps by interpolating between a few key positions; this information is placed in a four-column animation table, in.table. The model of the tank is stored in model.g as a combination named "tank." Its centroid is at the point (0,0,1000) and it faces the y-axis. An animation script for the tank itself is created as follows:

`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      30

This 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:

    -1500   -2000   30
    -1500   0       1000
    -1500   2000    30

and 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.

## BUGS

Tracks must have at least two wheels, and they must be listed in clockwise order, or the results are unpredictable.

## SEE ALSO

anim_script nged, anim_track nged

## AUTHOR

Carl J. Nuzman

## COPYRIGHT

This software is Copyright (c) 1993-2013 by the United States Government as represented by U.S. Army Research Laboratory.

## BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>.