Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > media > contrib-release > by-pkgid > 8079d983ecf371717db799dd75bd56c2 > files > 30

libopenrm1-1.5.2-2mdv2007.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head><title>OpenRM - RM Library (rmmatrix.c)</title></head>
<body bgcolor=white fgcolor=black>
<table width="100%" border=2 cellspacing=0 cellpadding=0 bgcolor="khaki" valign="center">
<th><img src="./images/ormsg.gif">
</th>
</table>
<spacer type=vertical size=15>
<h2>Index of OpenRM - RM Library</h2>
<spacer type=vertical size=15>
<a name="rmMatrixNew"> 
<pre><b>
 RMmatrix * rmMatrixNew (void)
</b></pre>
<pre>
 No arguments.
</pre>
<menu><P>
 Creates a new RMmatrix matrix, returning a handle to the new object
 to the caller upon success, or NULL upon failure.  Use rmMatrixDelete
 to free an RMmatrix object.
</P>
<P>
 The RMmatrix object is a 4x4 array of floating point values.
 Applications have two alternative approaches that may be used to set
 the individual values in the RMmatrix: either by using
 rmMatrixSetValue()/rmMatrixGetValue(), or through direct C-struct
 access.
</P>
<P>
 The RMmatrix object consists of a single 4x4 array of floating point
 values. The array is indexed with A[row][column], so that A[3][0]
 refers to an entry that is in the third row, and zero'th column. That
 particular entry controls translations along the X axis; in RM,
 matrix multiplies occur from the left.
</P>
<P>
 The general form of RMmatrices is
 <pre>
       |  1  0  0  0  |       |  Sx 0  0  0  |
       |  0  1  0  0  |       |  0  Sy 0  0  |
  T =  |  0  0  1  0  |   S = |  0  0  Sz 0  |
       |  Tx Ty Tz 1  |       |  0  0  0  1  |
 </pre>
</P>
<P>
 Where T and S are the translation and scale matrices, respectively.
</P>
<P>
 Access to a specific matrix entity using the C-struct interface would
 be performed as follows: to access the Tx, or X-axis translation in T
 above, Tx = matrix->m[3][0], where "matrix" is a handle to the
 RMmatrix object. The "m" entity is the single matrix struct inside
 the RMmatrix object.
</P>
<P>
 Access to the same element through the API would be: 
 Tx = rmMatrixGetValue(matrix,3,0).
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixCopy"> 
<pre><b>
 RMenum rmMatrixCopy (RMmatrix *dst,
	              const RMmatrix *src)
</b></pre>
<pre>
 RMmatrix *dst - a handle to the "copy to" RMmatrix (modified).

 const RMmatrix *src - a handle to the "copy from" RMmatrix (input).
</pre>
<menu><P>
 Copies the contents of one RMmatrix object to another. Returns
 RM_CHILL upon success, or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixDelete"> 
<pre><b>
 RMenum rmMatrixDelete (RMmatrix *toDelete)
</b></pre>
<pre>
 RMmatrix *toDelete - a handle to an RMmatrix object to delete
    (modified).
</pre>
<menu><P>
 Releases resources associated with an RMmatrix object. Returns
 RM_CHILL upon success, or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixIdentity"> 
<pre><b>
 RMenum rmMatrixIdentity (RMmatrix *toModify)
</b></pre>
<pre>
 RMmatrix *toModify - a handle to an RMmatrix object (modified).
</pre>
<menu><P>
 This routine will set the RMmatrix "toModify" to contain the Identity
 matrix. Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixSetValue"> 
<pre><b>
 RMenum rmMatrixSetValue (RMmatrix *toModify,
		          int row,
			  int col,
			  float newValue)
</b></pre>
<pre>
 RMmatrix *toModify - a handle to an RMmatrix object (modified).

 int row, col - integer values, treated as indices. Must both be in
    the range 0..3, otherwise an error condition results.

 float newValue - a floating point value to place into the RMmatrix
    object (input).
</pre>
<menu><P>
 Assigns a floating point value (newValue) to a single entry in the
 4x4 matrix contained in the RMmatrix object, returning RM_CHILL upon
 success or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixGetValue"> 
<pre><b>
 float rmMatrixGetValue (const RMmatrix *toQuery,
		         int row,
			 int col)
</b></pre>
<pre>
    query (input).

 int row, col - integer values assumed to be indices into the 4x4
    matrix contained within the RMmatrix object. Must be in the range
    0..3 else an error condition is detected.
</pre>
<menu><P>
 Use this routine to obtain the value of a single entry from a 4x4
 matrix within an RMmatrix object. Returns the entry at [row][col]
 from the matrix upon success, otherwise an error message is issued
 and 0.0 is returned.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixTranspose"> 
<pre><b>
 RMenum rmMatrixTranspose (const RMmatrix *src,
		           RMmatrix *dst)
</b></pre>
<pre>
 const RMmatrix *src - a handle to an RMmatrix object (input).

 RMmatrix *dst - a handle to an RMmatrix object (modified).
</pre>
<menu><P>
 Transposes the input matrix, copying the results back into the "dst"
 RMmatrix object. Returns RM_CHILL upon success, otherwise RM_WHACKED
 is returned.
</P>
<P>
 This routine is written such that "src" and "dst" may be the same
 RMmatrix object.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixMultiply"> 
<pre><b>
 RMenum rmMatrixMultiply (const RMmatrix *srcA,
		          const RMmatrix *srcB,
			  RMmatrix *dst)
</b></pre>
<pre>
 const RMmatrix *srcA, *srcB - handles to RMmatrix objects (input).

 RMmatrix *dst - a handle to an RMmatrix object (modified).
</pre>
<menu><P>
 Computes the matrix product srcA * srcB, placing the result into
 "dst".  Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P>
<P>
 Internally, rmMatrixMultiply is written such that "dst" may be the
 same RMmatrix object as either srcA or srcB.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmMatrixInverse"> 
<pre><b>
 RMenum rmMatrixInverse (const RMmatrix *src,
		         RMmatrix *dst)
</b></pre>
<pre>
 const RMmatrix *src - a handle to an RMmatrix object (input).

 RMmatrix *dst - a handle to an RMmatrix object (result).
</pre>
<menu><P>
 Will compute the inverse of the 4x4 matrix "src," placing the result
 into "dst". Returns RM_CHILL upon success, or RM_WHACKED upon
 failure.
</P>
<P>
 Matrix inversion is performed using Gaussian elimination using a
 customized version of SGEFA from the Linpack distribution. If the
 input matrix is singular, an error is reported with rmWarning(), and
 RM_WHACKED is returned.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPoint4MatrixTransform"> 
<pre><b>
 RMenum rmPoint4MatrixTransform (const float *src,
			         const RMmatrix *matrix,
				 float *dst)
</b></pre>
<pre>
 const float *src - a handle to an array of floats of length 4
    (input).

 const RMmatrix *matrix - a handle to an RMmatrix object.

 float *dst - a handle to an array of floats of length 4 (ouput).
</pre>
<menu><P>
 rmPoint4MatrixTransform is one of a family of routines that perform
 vector-matrix multiplication. This routine multiplies the vector
 "src" by the matrix, placing the result into vector "dst." It is
 assumed that both "src" and "dst" are floating point arrays of length
 4.  Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P>
<P>
 This routine is written such that "src" and "dst" may be the same
 array from the caller's perspective.
</P>
<P>
 This routine implements the following operation:
 <pre>
</P>
<P>
                 |  a  b  c  d  |
                 |  e  f  g  h  |
 [s0 s1 s2 s3] * |  i  j  k  l  | = [d0 d1 d2 d3]
		 |  m  n  o  p  |
</P>
<P>
 </pre>
</P>
<P>
 The "src" vector multiplies the matrix from the left (pre
 multiplication) such that each element of "dst" is the dot product of
 "src" with a column from the matrix.
</P>
<P>
 See also rmPointMatrixTransform.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPointMatrixTransform"> 
<pre><b>
 RMenum rmPointMatrixTransform (const RMvertex3D *src,
			        const RMmatrix *matrix,
			        RMvertex3D *dst)
</b></pre>
<pre>
 const RMvertex3D *src - a handle to an RMvertex3D object (input).

 const RMmatrix *matrix - a handle to an RMmatrix object.

 RMvertex3D *dst - a handle to an RMvertex3D (ouput). 
</pre>
<menu><P>
 rmPointMatrixTransform is one of a family of routines that perform
 vector-matrix multiplication. This routine multiplies the RMvertex3D
 "src" by the matrix, placing the result into RMvertex3D "dst."
</P>
<P>
 This routine differs from rmPoint4MatrixTransform in that it is
 assumed that the w-coordinate of both "src" and "dst" is 1.0, and
 that the resulting w-coordinate is not available to the caller upon
 return.
</P>
<P>
 Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P>
<P>
 This routine is written such that "src" and "dst" may be the same
 array from the caller's perspective.
</P>
<P>
 This routine implements the following operation:
 <pre>
</P>
<P>
                 |  a  b  c  d  |
                 |  e  f  g  h  |
 [s0 s1 s2 1]  * |  i  j  k  l  | = [d0 d1 d2 n/a]
		 |  m  n  o  p  |
</P>
<P>
 </pre>
</P>
<P>
 The "src" vector multiplies the matrix from the left (pre
 multiplication) such that each element of "dst" is the dot product of
 "src" with a column from the matrix.
</P>
<P>
 See also rmPoint4MatrixTransform.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPrintMatrix"> 
<pre><b>
 RMenum rmPrintMatrix (const RMmatrix *toPrint)
</b></pre>
<pre>
 const RMmatrix *toPrint - a handle to an RMmatrix that will be
    printed (input).
</pre>
<menu><P>
 Prints the contents of an RMmatrix object using C-printf's. Returns
 RM_CHILL upon success or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPointMin"> 
<pre><b>
 RMenum rmPointMin (const float *input,
	            int count,
		    int vdims,
		    int stride,
		    RMvertex3D *minReturn)
</b></pre>
<pre>
 const float *input - a handle to an array of floating point values
    (input).

 int count - an integer value indicating the number of "vertices" that
    will be processed (input).

 int vdims - an integer value indicating the cardinality, or number of
    dimensions, of each vertex. Should be either 1, 2 or 3 (input).

 int stride - an integer value specifying the stride length in floats
    from one vertex to the next (input).

 RMvertex3D *minReturn - a handle to an RMvertex3D object (modified).
</pre>
<menu><P>
 Finds the minimum point, or vertex value, from a flat array of
 floating point values. Upon success, the minimum vertex value is
 copied into the caller-supplied "minReturn," and RM_CHILL is
 returned. Otherwise, RM_WHACKED is returned upon failure.
</P>
<P>
 The parameter "vdims" defines the number of coordinates in each
 vertex. Use a value of 2 to specify two-dimensional vertices (x and y
 values), or 3 for three-dimensional vertices (x, y and z values).  A
 value of 1 is also acceptable.
</P>
<P>
 The parameter "count" specifies how many such vertices are present in
 the input array. Note that this routine assumes that "input" is just
 a flat array of floats, and will be logically interpreted as groups
 of vertices, each of which consists of "vdims" floats per vertex. The
 coordinates of each vertex are assumed to be contiguously located.
</P>
<P>
 The parameter "stride" tells how many floating point values to skip
 from one vertex to the next.  If we assume that "input" consists of a
 flat array of RMvertex3D objects (cast to float * when calling this
 routine), the best way to compute "stride" is:
</P>
<P>
 <pre>
       stride = sizeof(RMvertex3D)/sizeof(float)
 </pre>
</P>
<P>
 The reason for "stride" is because some platforms force padding of
 C-structures to the nearest 8-byte boundary. Hence,
 sizeof(RMvertex3D) is not always equal to sizeof(float)*3.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPointMax"> 
<pre><b>
 RMenum rmPointMax (const float *input,
	            int count,
		    int vdims,
		    int stride,
		    RMvertex3D *maxReturn)
</b></pre>
<pre>
 const float *input - a handle to an array of floating point values
    (input).

 int count - an integer value indicating the number of "vertices" that
    will be processed (input).

 int vdims - an integer value indicating the cardinality, or number of
    dimensions, of each vertex. Should be either 1, 2 or 3 (input).

 int stride - an integer value specifying the stride length in floats
    from one vertex to the next (input).

 RMvertex3D *maxReturn - a handle to an RMvertex3D object (modified).
</pre>
<menu><P>
 Finds the maximum point, or vertex value, from a flat array of
 floating point values. Upon success, the maximum vertex value is
 copied into the caller-supplied "maxReturn," and RM_CHILL is
 returned. Otherwise, RM_WHACKED is returned upon failure.
</P>
<P>
 The parameter "vdims" defines the number of coordinates in each
 vertex. Use a value of 2 to specify two-dimensional vertices (x and y
 values), or 3 for three-dimensional vertices (x, y and z values).  A
 value of 1 is also acceptable.
</P>
<P>
 The parameter "count" specifies how many such vertices are present in
 the input array. Note that this routine assumes that "input" is just
 a flat array of floats, and will be logically interpreted as groups
 of vertices, each of which consists of "vdims" floats per vertex. The
 coordinates of each vertex are assumed to be contiguously located.
</P>
<P>
 The parameter "stride" tells how many floating point values to skip
 from one vertex to the next.  If we assume that "input" consists of a
 flat array of RMvertex3D objects (cast to float * when calling this
 routine), the best way to compute "stride" is:
</P>
<P>
 <pre>
       stride = sizeof(RMvertex3D)/sizeof(float)
 </pre>
</P>
<P>
 The reason for "stride" is because some platforms force padding of
 C-structures to the nearest 8-byte boundary. Hence,
 sizeof(RMvertex3D) is not always equal to sizeof(float)*3.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmPointMinMax"> 
<pre><b>
 RMenum rmPointMinMax (const float *input,
	               int count,
		       int vdims,
		       int stride,
		       RMvertex3D *minReturn,
		       RMvertex3D *maxReturn)
</b></pre>
<pre>
 const float *input - a handle to an array of floating point values
    (input).

 int count - an integer value indicating the number of "vertices" that
    will be processed (input).

 int vdims - an integer value indicating the cardinality, or number of
    dimensions, of each vertex. Should be either 1, 2 or 3 (input).

 int stride - an integer value specifying the stride length in floats
    from one vertex to the next (input).

 RMvertex3D *minReturn, *maxReturn - handles to RMvertex3D objects
    (modified).
</pre>
<menu><P>
 Finds the minimum and maximum points, or vertex values, from a flat
 array of floating point values. Upon success, the minimum and maximum
 vertex values are copied into the caller-supplied "minReturn" and
 "maxReturn," respectively, and RM_CHILL is returned. Otherwise,
 RM_WHACKED is returned upon failure.
</P>
<P>
 The parameter "vdims" defines the number of coordinates in each
 vertex. Use a value of 2 to specify two-dimensional vertices (x and y
 values), or 3 for three-dimensional vertices (x, y and z values).  A
 value of 1 is also acceptable.
</P>
<P>
 The parameter "count" specifies how many such vertices are present in
 the input array. Note that this routine assumes that "input" is just
 a flat array of floats, and will be logically interpreted as groups
 of vertices, each of which consists of "vdims" floats per vertex. The
 coordinates of each vertex are assumed to be contiguously located.
</P>
<P>
 The parameter "stride" tells how many floating point values to skip
 from one vertex to the next.  If we assume that "input" consists of a
 flat array of RMvertex3D objects (cast to float * when calling this
 routine), the best way to compute "stride" is:
</P>
<P>
 <pre>
       stride = sizeof(RMvertex3D)/sizeof(float)
 </pre>
</P>
<P>
 The reason for "stride" is because some platforms force padding of
 C-structures to the nearest 8-byte boundary. Hence,
 sizeof(RMvertex3D) is not always equal to sizeof(float)*3.
</P>
<P>
 This routine internally calls rmPointMin, followed by rmPointMax.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DMag"> 
<pre><b>
 double rmVertex3DMag (const RMvertex3D *src)
</b></pre>
<pre>
 const RMvertex3D *src - a handle to an RMvertex3D object (input).
</pre>
<menu><P>
 Computes the vector magnitude of the input RMvertex3D object (a
 3-component vector), returning the result to the caller. If the input
 is NULL, an error message is reported, and -1.0 is returned.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DSum"> 
<pre><b>
 RMenum rmVertex3DSum (const RMvertex3D *a,
	               const RMvertex3D *b,
		       RMvertex3D *dst)
</b></pre>
<pre>
 const RMvertex3D *a, *b - handles to RMvertex3D objects (input).

 RMvertex3D *dst - a handle to an RMvertex3D object (result).
</pre>
<menu><P>
 Computes the vector sum (a + b), placing the result into "dst".  This
 is computed such that either a or b may be used as the result c.
 Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DDiff"> 
<pre><b>
 RMenum rmVertex3DDiff (const RMvertex3D *a,
	                const RMvertex3D *b,
		        RMvertex3D *dst)
</b></pre>
<pre>
 const RMvertex3D *a, *b - handles to RMvertex3D objects (input).

 RMvertex3D *dst - a handle to an RMvertex3D object (result).
</pre>
<menu><P>
 Computes the vector difference (a - b), placing the result into
 "dst".  This is computed such that either a or b may be used as the
 result c.  Returns RM_CHILL upon success, or RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DDot"> 
<pre><b>
 double rmVertex3DDot (const RMvertex3D *a,
	               const RMvertex3D *b)
</b></pre>
<pre>
 const RMvertex3D *a, *b - handles to RMvertex3D objects (input).
</pre>
<menu><P>
 Computes the vector dot product of the input RMvertex3D objects "a"
 and "b," returning the result. Upon failure, an error message is
 issued through RMwarning() and 0.0 is returned.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DCross"> 
<pre><b>
 RMenum rmVertex3DCross (RMvertex3D *p,
		         RMvertex3D *r,
			 RMvertex3D *result)
</b></pre>
<pre>
 RMvertex3D *p, *r - handles to RMvertex3D objects (input).

 RMvertex3D *result - a handle to an RMvertex3D object (result).
</pre>
<menu><P>
 Computes the vector cross product of the two input vectors "P" and
 "R", placing the resulting vector into "result". Returns RM_CHILL
 upon success or RM_WHACKED upon failure.
</P>
<P>
 This routine is written such that "result" may be the same object as
 either P or R.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DNormalize"> 
<pre><b>
 RMenum rmVertex3DNormalize (RMvertex3D *toNormalize)
</b></pre>
<pre>
 RMvertex3D *toNormalize - a handle to the RMvertex3D object
    (modified).
</pre>
<menu><P>
 Use this routine to normalize the 3-component vector contained in an
 RMvertex3D object. Inside this routine, the vector magnitude of the
 RMvertex3D object is computed. Next, if the magnitude is non-zero,
 each component of the vector is divided by the magnitude, and
 RM_CHILL is returned. If the magnitude is zero, RM_WHACKED is
 returned.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DMagNormalize"> 
<pre><b>
 RMenum rmVertex3DMagNormalize (RMvertex3D *toNormalize,
		                double *magReturn)
</b></pre>
<pre>
 RMvertex3D *toNormalize - a handle to an RMvertex3D object
    (modified).

 double *magReturn - a pointer to a double (result).
</pre>
<menu><P>
 Use this routine when you want to normalize a vector, and get the
 vector magnitude of the unnormalized vector in one call.
</P>
<P>
 A return value of RM_CHILL means that all's well, while a return
 value of RM_WHACKED means that either one of the input parameters was
 NULL, or that the input RMvertex3D had a zero-valued vector
 magnitude.
</P>
<P>
 Upon success, the input RMvertex3D is normalized in-situ, and the
 vector magnitude (used to normalize the vector) is returned in the
 caller-supplied memory.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmVertex3DMidpoint"> 
<pre><b>
 RMenum rmVertex3DMidpoint (const RMvertex3D *a,
		            const RMvertex3D *b,
			    RMvertex3D *dst)
</b></pre>
<pre>
 const RMvertex3D *a,*b - handles to RMvertex3D objects (input).

 RMvertex3D *dst - a handle to an RMvertex3D object (result).
</pre>
<menu><P>
 Computes the midpoint between the two RMvertex3D objects "a" and "b",
 placing the result into "dst". Returns RM_CHILL upon success, or
 RM_WHACKED upon failure.
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmDCFromWC3"> 
<pre><b>
 RMenum rmDCFromWC3 (const RMvertex3D *src,
	             RMvertex3D *dst,
		     int nPoints,
		     const RMcamera3D *cam3d,
		     const RMmatrix *model,
		     float viewPort[4],
		     int windowWidth,
		     int windowHeight)
</b></pre>
<pre>
 const RMvertex3D *src - an array of RMvertex3D objects (input).

 RMvertex3D *dst - an array of RMvertex3D objects (result).

 int nPoints - an integer value indicating the number of points from
    "src" that will be transformed.

 RMcamera3D *cam3d - a handle to an RMcamera3D object that specifies
    view geometry (input).

 RMmatrix *model - an RMmatrix object specifying a model
    transformation in world coordinates (input). This parameter is
    optional, and NULL may be used in place of an RMmatrix object.

 float viewPort[4] - an array of floating point values (length 4)
    specifying the viewport geometry within the display window. Each
    array value should be in the range 0..1. The array is in the
    following order: xmin, ymin, xmax,ymax. In other words, the
    viewport is specified using two coordinates defining the min/max
    corners of the viewport in NDC space.

 int windowWidth, windowHeight - integer values specifying the width
    and height in pixels of the display window (input).
</pre>
<menu><P>
 Use this routine to compute the device coordinates from world
 coordinates.  RM_CHILL is returned upon success, or RM_WHACKED upon
 failure.
</P>
<P>
 Each RMvertex3D from "src", of which there are nPoints, is
 transformed through a derived projection matrix producing window
 (pixel) coordinates that are placed into "dst." Each dst[i]
 represents the projected window coordinates of src[i]. The derived
 projection matrix consists of an optional modeling transformation
 matrix (model), and a viewing matrix computed from the camera model
 defined by the input RMcamera3D object.
</P>
<P>
 Note that no window is required, the projected coordinates are
 computed using the window and viewport dimensions specified by the
 input, no actual rendering occurs (OpenGL is not involved with this
 routine).
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
<a name="rmDCFromWC2"> 
<pre><b>
 RMenum rmDCFromWC2 (const RMvertex2D *src,
	             RMvertex2D *dst,
		     int nPoints,
		     const RMcamera2D *cam3d,
		     const RMmatrix *model,
		     float viewPort[4],
		     int windowWidth,
		     int windowHeight)
</b></pre>
<pre>
 const RMvertex2D *src - an array of RMvertex2D objects (input).

 RMvertex2D *dst - an array of RMvertex2D objects (result).

 int nPoints - an integer value indicating the number of points from
    "src" that will be transformed.

 RMcamera2D *cam2d - a handle to an RMcamera2D object that specifies
    view geometry (input).

 RMmatrix *model - an RMmatrix object specifying a model
    transformation in world coordinates (input). This parameter is
    optional, and NULL may be used in place of an RMmatrix object.

 float viewPort[4] - an array of floating point values (length 4)
    specifying the viewport geometry within the display window. Each
    array value should be in the range 0..1. The array is in the
    following order: xmin, ymin, xmax,ymax. In other words, the
    viewport is specified using two coordinates defining the min/max
    corners of the viewport in NDC space.

 int windowWidth, windowHeight - integer values specifying the width
    and height in pixels of the display window (input).
</pre>
<menu><P>
 Use this routine to compute the device coordinates from world
 coordinates.  RM_CHILL is returned upon success, or RM_WHACKED upon
 failure.
</P>
<P>
 Each RMvertex2D from "src", of which there are nPoints, is
 transformed through a derived projection matrix producing window
 (pixel) coordinates that are placed into "dst." Each dst[i]
 represents the projected window coordinates of src[i]. The derived
 projection matrix consists of an optional modeling transformation
 matrix (model), and a viewing matrix computed from the camera model
 defined by the input RMcamera2D object.
</P>
<P>
 Note that no window is required, the projected coordinates are
 computed using the window and viewport dimensions specified by the
 input, no actual rendering occurs (OpenGL is not involved with this
 routine).
</P></menu>
<i>librm library source file: rmmatrix.c </i><hr width="75%">
</body></html>