DATAMANIP (kdatamanip) functions


LIBRARY ROUTINE

lklocxform - transform location data

LIBRARY CALL

int lklocxform(
   kobject src_obj,
   double  xrot,
   double  yrot,
   double  zrot,
   double  xtrans,
   double  ytrans,
   double  ztrans,
   double  xscale,
   double  yscale,
   double  zscale,
   kobject dst_obj)

INPUT

OUTPUT

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

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.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATAMANIP/objects/library/kdatamanip/src/lklocxform.c

SEE ALSO

kdatamanip(3)

COPYRIGHT

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