TRANSLATE 3(3P) — SUNPHIGS LIBRARY
NAME
TRANSLATE 3 − calculate a 3D transformation matrix to perform a specified translation
SYNOPSIS
C Syntax
void
ptranslate3 ( trans_vector, error_ind, matrix )
Pvector3∗trans_vector;translation vector
Pint∗error_ind;OUT error indicator
Pmatrix3matrix;OUT transformation matrix
FORTRAN Syntax
SUBROUTINE ptr3 ( DX, DY, DZ, ERRIND, XFRMT )
REALDX, DY, DZtranslation vector
INTEGERERRINDOUT error indicator
REALXFRMT(4, 4)OUT transformation matrix
Required PHIGS Operating States
(PHOP, ∗, ∗, ∗)
DESCRIPTION
Purpose
Use TRANSLATE 3 to generate a 3D homogeneous (4 x 4) transformation matrix that performs a 3D translation.
The returned matrix may be passed as an argument to SET LOCAL TRANSFORMATION 3 or SET GLOBAL TRANSFORMATION 3 to modify the modelling transformation that is applied to output primitives during traversal.
C Input Parameter
trans_vector
A pointer to a Pvector3 structure containing the Modelling Coordinate translation values to be applied in the x, y and z dimensions. Pvector3 is defined in phigs.h as follows:
typedef struct {
Pfloat x;/∗ the X axis translation value. ∗/
Pfloat y;/∗ the Y axis translation value. ∗/
Pfloat z;/∗ the Z axis translation value. ∗/
} Pvector3;
C Output Parameters
error_ind
A pointer to the location to store the error number of any error detected by this function.
matrixThe 4 x 4 homogeneous transformation matrix that performs the specified translation. Pmatrix is defined in phigs.h as follows:
typedef PfloatPmatrix3[4][4];
FORTRAN Input Parameters
DX, DY, DZ
The translation values to be applied in the x, y and z dimensions.
FORTRAN Output Parameters
ERRIND
The error number of any error detected by this function.
XFRMT
The 4 x 4 homogeneous transformation matrix that performs the specified translation.
Execution
TRANSLATE 3 returns a 3D homogeneous (4 x 4) transformation matrix that performs the translation specified by translation vector.
The translation vector specifies the translation distance in the x, y and z directions.
ERRORS
002Ignoring function, function requires state (PHOP, ∗, ∗, ∗)
SEE ALSO
SET LOCAL TRANSFORMATION 3 (3P)
SET GLOBAL TRANSFORMATION 3 (3P)
SET VIEW REPRESENTATION 3 (3P)
ROTATE X (3P)
ROTATE Y (3P)
ROTATE Z (3P)
SCALE 3 (3P)
BUILD TRANSFORMATION MATRIX 3 (3P)
COMPOSE TRANSFORMATION MATRIX 3 (3P)
COMPOSE MATRIX 3 (3P)
TRANSFORM POINT 3 (3P)
TRANSLATE (3P)
Sun Release 4.0 — Last change: 7 July 1989