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