REPLACE_MATRIX(3G)
NAME
replace_matrix − replace the current transformation matrix with a specified matrix.
SYNOPSIS
C SYNTAX
void replace_matrix2d(fildes,xform2);
int fildes;
float xform2[3][2];
void replace_matrix3d(fildes,xform3);
int fildes;
float xform3[4][4];
FORTRAN77 SYNTAX
See Language Dependencies Below
subroutine replace_matrix2d(fildes,xform2)
integer*4 fildes
real xform2(2,3)
subroutine replace_matrix3d(fildes,xform3)
integer*4 fildes
real xform3(4,4)
PASCAL SYNTAX
type
two_d_xform = array [1..3][1..2] of real;
three_d_xform = array [1..4][1..4] of real;
procedure replace_matrix2d(fildes:integer;
var xform2:two_d_xform);
procedure replace_matrix3d(fildes:integer;
var xform3:three_d_xform);
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: HP
DESCRIPTION
INPUT PARAMETER
fildes
is an integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
xform2
is a 3x2 2-Dimensional matrix.
xform3
is a 4x4 3-Dimensional matrix.
DISCUSSION
The current transformation matrix (top of matrix stack) is replaced by the specified matrix, xform2 or xform3 concatenated with the vdc-to-device units transformation matrix. This concatenation with the vdc-to-device matrix can be avoided for performance by setting the vdcs to be equal to device coordinates (see vdc_extent). The current transformation matrix is used to transform subsequent output primitives.
The vdc-to-device units transformation matrix cannot be replaced using replace_matrix2d or replace_matrix3d. It can be changed using vdc_extent, viewport_justification, set_p1_p2, or mapping_mode. If there is only one matrix (the vdc-to-device matrix) in the matrix stack, replace_matrix will generate a warning.
Within Starbase, all matrices are maintained in 3D (4x4) form, so replace_matrix2d must expand the matrix xform2.
Since the vdc-to-device units transformation matrix is post-conncatenated to the end of this matrix, care should be taken when performing perspective transformations. A perspective model where the eye is at origin of perspective space is recommended. Any other model can easily be modified by a single translation step.
LANGUAGE DEPENDENCIES
FORTRAN77
A transposition of array rows and columns is required due to the manner in which FORTRAN77 stores arrays.
DEFAULTS
After gopen the current transformation matrix is the vdc-to-device units transformation matrix.
SEE ALSO
vdc_extent(3g), set_p1_p2(3g), viewport_justification(3g), mapping_mode(3g), concat_matrix(3g), push_matrix(3g), pop_matrix(3g), push_vdc_matrix(3g).
Hewlett-Packard — last mod. May 11, 2021