Matrix Creation(1)

NAME
C_identity3D, C_scale3D, C_translate3D, C_rotate3D - routines to create a transformation matrix

SYNOPSIS
 # include <math.h>
 # include "VolVis.h"
 C_identity3D( M )
 C_Matrix    *M;
 C_scale3D( sx, sy, sz, M )
 float       sx, sy, sz;
 C_Matrix    *M;
 C_translate3D( tx, ty, tz, M )
 float       tx, ty, tz;
 C_Matrix    *M;
 C_rotate3D( axis, angle, M )
 char        axis;
 float       angle;
 C_Matrix    *M;

PARAMETERS
 M       the matrix returned by the routine
 sx      expects the x scale factor
 sy      expects the y scale factor
 sz      expects the z scale factor
 tx      expects the x translation factor
 ty      expects the y translation factor
 tz      expects the z translation factor
 axis    expects the axis of rotation.  The three
                 valid values for this parameter are:

                 X_AXIS to indicate the x-axis
                 Y_AXIS to indicate the y-axis
                  Z_AXIS to indicate the z-axis

 angle    expects the angle (in radians) of rotation

DESCRIPTION
The matrix M returned by each of these routines is a 4x4 matrix using a modified homogeneous coordinate representation of points in 3-space. In a homogeneous coordinate representation, a point in 3-space is denoted by the quadruple (x, y, z, w), which is equivalent to the point (x/w, y/w, z/w) in the standard representation of a point. In VolVis, this homogeneous coordinate representation is modified so that w is always 1. Therefore the homogeneous coordinate (x, y, z, 1) is just (x, y, z) in the standard representation. Using a 4x4 matrix for transformations allows the VolVis system to incorporate translations into the transformation matrix, which would not be possible using the standard 3x3 matrix. C_identity3D returns the following identity matrix in M:

C_scale3D returns the following scale matrix in M:

C_translate3D returns the following translation matrix in M:

C_rotate3D returns the a rotation matrix in M, depending on the value of axis.

  If axis is X_AXIS, M is:

  If axis is Y_AXIS, M is:

  If axis is Z_AXIS, M is:

SEE ALSO
C_transform_point(2), C_transform_vector(2), C_create_volume_matrices(2), C_matrix_multiply(2) C_copy_matrix(2)

AUTHOR
    Lisa Sobierajski