DATAMANIP commands


PROGRAM NAME

klocxform - Rotate, Translate, and Scale Location Data

DESCRIPTION

This routine performs a homogeneous coordinate transformation on the location data in the source object, and saves the transformed location data into the destination object.

The source object must have location data, and the destination object must not have location data for this routine to function properly. This routine will create location data of the proper grid type in the destination.

The coordinate transformation can be specfied by nine parameters which specify an x-y-z rotation, an x-y-z translation, and an x-y-z scaling. The rotations are all performed with respect to the (0,0,0) origin. A scaling matrix, a translation matrix, and three rotation matrices are constructed from these specified parameters and composited into a single transformation matrix in the following order :

[1] Scaling [2] X Rotation [3] Y Rotation [4] Z Rotation [5] Translation

A value of 1.0 should be used for any scaling parameters where no scaling is desired. A value of 0.0 should be used for any rotation parameters where no rotation is desired or for any translation parameters where no translation is desired.

The location points are interpreted to be in three-space for the transformations. Explicit location data located in dimensions higher than three will be lost during the transformation. The transformation will be performed using the datatype KFLOAT.

In general, the grid type of the source object will be preserved in the destination object. For example, uniform location data, when transformed and stored in the destination object, will still be uniform location data. The exception to this rule is rectilinear data, which must be converted to curvilinear data in the event of a rotation. In this case the destination location data will be stored as explicit curvilinear data points.

Reference : Foley & VanDam "Computer Graphics : Principles and Practice", Second Edition, 1990, Chapter 5.

REQUIRED ARGUMENTS

-i
type: infile
desc: the input object to be processed
-o
type: outfile
desc: the output object

OPTIONAL ARGUMENTS

-xrot
type: float
desc: rotate around x axis
default: 0
bounds: -360 < [-xrot] < 360
-yrot
type: float
desc: rotate around y axis
default: 0
bounds: -360 < [-yrot] < 360
-zrot
type: float
desc: rotate around z axis
default: 0
bounds: -360 < [-zrot] < 360
-fx
type: flag
desc: flip x coordinates
-xtrans
type: float
desc: translate in x direction
default: 0
bounds: no range checking
-fy
type: flag
desc: flip y coordinates
-ytrans
type: float
desc: translate in y direction
default: 0
bounds: no range checking
-fz
type: flag
desc: flip z coordinates
-ztrans
type: float
desc: translate in z direction
default: 0
bounds: no range checking

Mutually Exclusive Group; if desired, specify ONE of:

-scale
type: float
desc: orthogonal scale factor
default: 1
bounds: value > 0.0
OR

AT LEAST ONE OF the Group:

-xscale
type: float
desc: scale x coordinates
default: 1
bounds: value > 0.0
AND/OR
-yscale
type: float
desc: scale y coordinates
default: 1
bounds: value > 0.0
AND/OR
-zscale
type: float
desc: scale z coordinates
default: 1
bounds: value > 0.0

EXAMPLES

SEE ALSO

RESTRICTIONS

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.