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. |
void N3DMatrixIdentity | ( | N3DMATRIX & | _dest | ) |
Creates an identity matrix.
[in,out] | _dest | Reference to a N3DMATRIX structure that is the result of the operation. |
Multiply two matrices.
[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. |
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.
[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. |
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); }
Builds a matrix that rotates around the x-axis.
[in,out] | _dest | Reference to a N3DMATRIX structure that is the result of the operation. |
[in] | _angle | Angle of rotation in radians. |
Builds a matrix that rotates around the y-axis.
[in,out] | _dest | Reference to a N3DMATRIX structure that is the result of the operation. |
[in] | _angle | Angle of rotation in radians. |
Builds a matrix that rotates around the y-axis.
[in,out] | _dest | Reference to a N3DMATRIX structure that is the result of the operation. |
[in] | _angle | Angle of rotation in radians. |
void N3DMatrixScaling | ( | N3DMATRIX & | _dest, | |
const N3DFLOAT | _sx, | |||
const N3DFLOAT | _sy, | |||
const N3DFLOAT | _sz | |||
) |
Builds a scaling matrix.
[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. |
void N3DMatrixTranslation | ( | N3DMATRIX & | _dest, | |
const N3DFLOAT | _x, | |||
const N3DFLOAT | _y, | |||
const N3DFLOAT | _z | |||
) |
Builds a matrix using the specified coordinate-offsets.
[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 |
Builds a scaling matrix.
[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. |