N3DMATRIX Functions


Data Structures

struct  N3DMATRIX
 Describes a 4x4 matrix. More...

Functions

void N3DMatrixIdentity (N3DMATRIX &_dest)
 Creates an identity matrix.
void N3DMatrixMultiply (N3DMATRIX &_dest, const N3DMATRIX &_m1, const N3DMATRIX &_m2)
 Multiply two matrices.
void N3DMatrixPerspectiveFovLH (N3DMATRIX &_dest, const N3DFLOAT _fovY, const N3DFLOAT _aspect, const N3DFLOAT _zn, const N3DFLOAT _zf)
 Builds a left-handed perspective projection matrix based on a field of view.
void N3DMatrixRotationX (N3DMATRIX &_dest, const N3DFLOAT _angle)
 Builds a matrix that rotates around the x-axis.
void N3DMatrixRotationY (N3DMATRIX &_dest, const N3DFLOAT _angle)
 Builds a matrix that rotates around the y-axis.
void N3DMatrixRotationZ (N3DMATRIX &_dest, const N3DFLOAT _angle)
 Builds a matrix that rotates around the y-axis.
void N3DMatrixScaling (N3DMATRIX &_dest, const N3DFLOAT _sx, const N3DFLOAT _sy, const N3DFLOAT _sz)
 Builds a scaling matrix.
void N3DMatrixTranslation (N3DMATRIX &_dest, const N3DFLOAT _x, const N3DFLOAT _y, const N3DFLOAT _z)
 Builds a matrix using the specified coordinate-offsets.
void N3DMatrixUniformScaling (N3DMATRIX &_dest, const N3DFLOAT _s)
 Builds a scaling matrix.

Function Documentation

void N3DMatrixIdentity ( N3DMATRIX _dest  ) 

Creates an identity matrix.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.

void N3DMatrixMultiply ( N3DMATRIX _dest,
const N3DMATRIX _m1,
const N3DMATRIX _m2 
)

Multiply two matrices.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _m1 Reference to a source N3DMATRIX structure.
[in] _m2 Reference to a source N3DMATRIX structure.
Example:
    N3DMATRIX matRotation;
    N3DMATRIX matTranslation;
    N3DMATRIX matFinal;

    N3DMatrixRotationY(matRotation, DegreeToRadian(N3DFLOAT(45.0f)));
    N3DMatrixTranslation(matTranslation, N3DFLOAT(5.0f), N3DFLOAT(0.0f), N3DFLOAT(-10.0f));

    N3DMatrixMultiply(matFinal, matRotation, matTranslation);

void N3DMatrixPerspectiveFovLH ( N3DMATRIX _dest,
const N3DFLOAT  _fovY,
const N3DFLOAT  _aspect,
const N3DFLOAT  _zn,
const N3DFLOAT  _zf 
)

Builds a left-handed perspective projection matrix based on a field of view.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _fovY Field of view in y direction, specified in radians.
[in] _aspect Aspect ratio
int] _zn Near plane z-value of the view volume.
int] _zf Far plane z-value of the view volume.
Remarks:
The near and far view planes are relative offsets from the eye point.
Example:
N3DDEVICE g_device;

void SetupProjectionMatrix()
{
    N3DMATRIX projMatrix;

    N3DMatrixPerspectiveFovLH(projMatrix, N3DFLOAT(N3D_PI / 4.0f), N3DFLOAT(4.0f / 3.0f), N3DFLOAT(1.0f), N3DFLOAT(100.0f));
    g_device.SetTransform(N3DTS_PROJECTION, projMatrix);
}

void N3DMatrixRotationX ( N3DMATRIX _dest,
const N3DFLOAT  _angle 
)

Builds a matrix that rotates around the x-axis.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _angle Angle of rotation in radians.
See also:
N3DMatrixRotationY, N3DMatrixRotationZ

void N3DMatrixRotationY ( N3DMATRIX _dest,
const N3DFLOAT  _angle 
)

Builds a matrix that rotates around the y-axis.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _angle Angle of rotation in radians.
See also:
N3DMatrixRotationX, N3DMatrixRotationZ

void N3DMatrixRotationZ ( N3DMATRIX _dest,
const N3DFLOAT  _angle 
)

Builds a matrix that rotates around the y-axis.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _angle Angle of rotation in radians.
See also:
N3DMatrixRotationX, N3DMatrixRotationY

void N3DMatrixScaling ( N3DMATRIX _dest,
const N3DFLOAT  _sx,
const N3DFLOAT  _sy,
const N3DFLOAT  _sz 
)

Builds a scaling matrix.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _sx Scaling factor that is applied along the x-axis.
[in] _sy Scaling factor that is applied along the y-axis.
[in] _sz Scaling factor that is applied along the z-axis.
See also:
N3DMatrixUniformScaling

void N3DMatrixTranslation ( N3DMATRIX _dest,
const N3DFLOAT  _x,
const N3DFLOAT  _y,
const N3DFLOAT  _z 
)

Builds a matrix using the specified coordinate-offsets.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _x x-coordinate offset
[in] _y y-coordinate offset
[in] _z z-coordinate offset

void N3DMatrixUniformScaling ( N3DMATRIX _dest,
const N3DFLOAT  _s 
)

Builds a scaling matrix.

Parameters:
[in,out] _dest Reference to a N3DMATRIX structure that is the result of the operation.
[in] _s Scaling factor that is applied along the x, y and z-axis.
See also:
N3DMatrixScaling


Generated on Wed Aug 29 19:48:04 2007 for N3D by  doxygen 1.5.3