PLROT(1)

NAME
plrot - rotate, translate, or scale a UnixPlot file

SYNOPSIS
plrot [-x# -y# -z#] [-X# -Y# -Z#] [-s#] [-a# -e#] [-g#] [-M] [-m#] [-v] [-S#] < unix_plot > unix_plot

DESCRIPTION
Plrot will rotate translate or scale a UnixPlot file (see plot(5)). Any number of the above options can be given. Each operation is performed left to right in the order in which they appear on the command line, and the operations are concatenated. It is important to note that rotations are not commutative, so the order they are specified in is important. Typing the command without any arguments gives a useful summary.

The lower case -x# -y# -z# flags perform a rotation about the X, Y, and Z axis respectively by the given number of degrees. A positive value indicates a right handed rotation. Upper case -X# -Y# -Z# are translations along these axis in whatever units the plot file is in. The -s# flag applies a scale factor up (> 1) or down (< 1) to the plot.

The -a# -e# flags are for azimuth and elevation about the center point. They are really shorthands for positive Z axis and negative X axis rotations respectively, and should be used in the order shown for the proper combined effect to occur. These flags also cause the plot to auto-center based on the "space" command in the plot file, and the new "space" command will be shrunk to fit the rotated plot as tightly as possible.

The -M flag causes the plot to auto-center based on the "space" command in the plot file in much the same way that the rt(1) ray tracer does to a model bounding box. I.e. a sphere is fit to this space and the diameter and center of this sphere are used as the center and width of the plot in all three dimensions. This has the advantage of keeping the entire model in view from any angle, and is invariant with respect to viewing direction. It has the disadvantage that the "space" will be enlarged on every cascaded pass through plrot(1) where the -M flag is used.

The -S# flags takes a quoted string of 6 floating point numbers, which are immediately output as a "space" command, and which override any "space" commands found in the input file or which are computed by

The -v flag signals that verbose mode is requested. When set, the initial transformation matrix is printed. In addition, every time a space command is encountered in the input file, the old and new bounding RPP is printed.

The -m# flag takes a quoted string of 16 floating point numbers as its parameter. This string is a 4x4 rotation matrix (see h/vmath.h for details). Note that when using this flag, do not use -a#, -e#, or -g.

UnixPlot is traditionally a first quadrant 2D plotting space with X increasing to the right of the plot, and Y increasing up the plot. The "front" of a solid model in the BRL-CAD Package is traditionally defined by the right handed system of X comming out of the screen toward you, Y increasing to the right, and Z increasing up the display (elevation above the XY ground plane). The -g flag is a convenient shorthand to transform azimuths and elevations described in gift notation (as degrees off the front or -X view) into the UnixPlot coordinate system for display. If used, this option should usually appear as the last argument, because it acts by modifying the rotation already established. The -g command has exactly the same effect as giving -z-90 -x-90 in the same place.

EXAMPLES
The command
plrot -z30 -x20 < file.plot > file2.plot
performs a 30 degree positive rotation about the Z axis (counter clockwise as viewed from the top), and then translates by 20 units along this rotated axis. If the order of these arguments was reversed the effect would not be the same.

To view a plot of a model the way one would see it from a ray trace command, you could use:
rthide -a35 -e25 -o file.plot
plrot -a35 -e25 -g < file.plot pl-fb
The final -g converts the gift style azimuth and elevations into the conventional UnixPlot (screen) X,Y coordinate system.

SEE ALSO
pl-pl(1), pldebug(1), pl-fb(1), libplot3(3), plot(5)

AUTHORS
Phillip Dykstra

SOURCE
SECAD/VLD Computing Consortium, Bldg 394
The U. S. Army Ballistic Research Laboratory
Aberdeen Proving Ground, Maryland 21005

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