BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_matrix34
Next|Prev|Up
The Structure
Members
Arithmetic
BrMatrix34Mul()
BrMatrix34Inverse()
BrMatrix34LPInverse()
BrMatrix34Apply()
BrMatrix34ApplyP()
BrMatrix34ApplyV()
BrMatrix34TApply()
BrMatrix34TApplyP()
BrMatrix34TApplyV()
BrMatrix34Pre()
BrMatrix34PreTranslate()
BrMatrix34PreScale()
BrMatrix34PreShearX()
BrMatrix34PreShearY()
BrMatrix34PreShearZ()
BrMatrix34PreRotate()
BrMatrix34PreRotateX()
BrMatrix34PreRotateY()
BrMatrix34PreRotateZ()
BrMatrix34PreTransform()
BrMatrix34Post()
BrMatrix34PostTranslate()
BrMatrix34PostScale()
BrMatrix34PostShearX()
BrMatrix34PostShearY()
BrMatrix34PostShearZ()
BrMatrix34PostRotate()
BrMatrix34PostRotateX()
BrMatrix34PostRotateY()
BrMatrix34PostRotateZ()
BrMatrix34PostTransform()
Conversion
BrMatrix34ToEuler()
BrMatrix34ToQuat()
BrMatrix34ToTransform()
Copy/Assign
BrMatrix34Copy()
BrMatrix34Copy4()
Access & Maintenance
BrMatrix34LPNormalise()
Referencing & Lifetime
Initialisation
BrMatrix34Identity()
BrMatrix34Translate()
BrMatrix34Scale()
BrMatrix34ShearX()
BrMatrix34ShearY()
BrMatrix34ShearZ()
BrMatrix34RotateX()
BrMatrix34RotateY()
BrMatrix34RotateZ()
BrMatrix34Rotate()

br_matrix34


The Structure

A three column, four row, scalar array, used as a 3D affine matrix for general purpose 3D transformations (translation, scaling, shearing, rotation). Functions are provided to allow it be used as though it were an integral type. It has the following form:

Note that this is effectively used as a 44 matrix, but omitting the redundant, fourth column for storage purposes. Thus:

It is applied to homogenous 3D co-ordinates, which similarly omit the fourth element for sake of economy.

It can be noted that the bottom row has a translational effect. Also note, that the matrix determinant represents the volume change effected.

The typedef

(See matrix.h for precise declaration and ordering)

br_scalar m[4][3] Four rows of three columns

Related Functions

Scene Modelling

See BrActorToActorMatrix34()
82.

Maths

See BrMatrix4Pre34()219, BrMatrix4Copy34()223.

Miscellaneous

See BrMatrix34RollingBall()69.

Related Structures

See br_matrix4214, br_material151, br_pick3d_cbfn270.

Members

br_scalar m[4][3]

Each element of the matrix can be freely and individually accessed.

This matrix can also be thought of as an array of four br_vector3356 structures, e.g. br_vector3 m[4]. Thus m[row] can be cast as (br_vector3*).

Arithmetic


BrMatrix34Mul()

Description:
Multiply two matrices together and place the result in a third matrix. Equivalent to the expression:

Declaration:
void BrMatrix34Mul(br_matrix34* A, const br_matrix34* B, const br_matrix34* C)

Arguments:
br_matrix34 * A

A pointer to the destination matrix (must be different from both sources).

const br_matrix34 * B

Pointer to the left hand source matrix.

const br_matrix34 * C

Pointer to the right hand source matrix.

Remarks:
The result in A is equivalent to the following:

See Also:
BrMatrix34Pre()
194, BrMatrix34Post()199


BrMatrix34Inverse()

Description:
Compute the inverse of the supplied 3D affine matrix. Equivalent to the expression:

Declaration:
br_scalar BrMatrix34Inverse(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the destination matrix (must be different from source).

const br_matrix34 * B

A pointer to the source matrix.

Result:
br_scalar

If the inverse exists, the determinant of the source matrix is returned. If there is no inverse, scalar zero is returned.

Remarks:
Remember that while an inverse may be obtained using double precision arithmetic, this does not necessarily mean that it can using the br_scalar
332 type. This difference is most marked between fixed and floating point BRender libraries.

See Also:
BrMatrix34LPInverse()190.


BrMatrix34LPInverse()

Description:
Compute the inverse of the supplied length preserving
*1 transformation matrix. The resulting matrix is undefined for non-length preserving matrices.

Equivalent to the expression:

Declaration:
void BrMatrix34LPInverse(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the destination matrix (must be different from source).

const br_matrix34 * B

A pointer to the source matrix.

See Also:
BrMatrix34Inverse()189.


BrMatrix34Apply()

Description:
Applies a transform to a 3D point which may have non-unity homogenous co-ordinates. Equivalent to the expression:

Declaration:
void BrMatrix34Apply(br_vector3* A, const br_vector4* B, const br_matrix34* C)

Arguments:
br_vector3
*2 * A

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed point.

const br_vector4 * B

A pointer to the source vector, holding the point to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied.

Remarks:
Be aware that the fourth element of the resulting vector is only implicit, and if required must either be copied (if the destination is actually a br_vector4365) or used to scale down the first three elements. This all depends on the purpose for which this function is called.

The result in A is equivalent to the following:


BrMatrix34ApplyP()

Description:
Applies a transform to a 3D point. Equivalent to the expression:

Declaration:
void BrMatrix34ApplyP(br_vector3* A, const br_vector3* B, const br_matrix34* C)

Arguments:
br_vector3 * A

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed point.

const br_vector3 * B

A pointer to the source vector, holding the point to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied.

Remarks:
The result in A is equivalent to the following:


BrMatrix34ApplyV()

Description:
Applies a transform to a 3D vector, i.e. as for a point but without translation components (a vector has no location). Equivalent to the expression:

Declaration:
void BrMatrix34ApplyV(br_vector3* A, const br_vector3* B, const br_matrix34* C)

Arguments:
br_vector3 * A

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed vector.

const br_vector3 * B

A pointer to the source vector, holding the vector to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied.

Remarks:
The result in A is equivalent to the following:


BrMatrix34TApply()

Description:
Applies a transform to a transposed 3D point which may have non-unity homogenous co-ordinates. Equivalent to the expression:

Declaration:
void BrMatrix34TApply(br_vector4* A, const br_vector4* B, const br_matrix34* C)

Arguments:
br_vector4 * A

A pointer to the destination vector (must be different from source), to hold the transformed point.

const br_vector4 * B

A pointer to the source vector, holding the point to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied transposed.

Remarks:
The result in A is equivalent to the following:


BrMatrix34TApplyP()

Description:
Applies a transposed transform to a 3D point. Equivalent to the expression:

Declaration:
void BrMatrix34TApplyP(br_vector3* A, const br_vector3* B, const br_matrix34* C)

Arguments:
br_vector3 * A

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed point.

const br_vector3 * B

A pointer to the source vector, holding the point to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied transposed - the translation elements are presumed zero or irrelevant.

Remarks:
The result in A is equivalent to the following:


BrMatrix34TApplyV()

Description:
Applies a transposed transform to a 3D vector, i.e. as for a point but without translation components (a vector has no location). Equivalent to the expression:

Declaration:
void BrMatrix34TApplyV(br_vector3* A, const br_vector3* B, const br_matrix34* C)

Arguments:
br_vector3 * A

A pointer to the destination vector (must be different from source, and not part of transform), to hold the transformed vector.

const br_vector3 * B

A pointer to the source vector, holding the vector to be transformed.

const br_matrix34 * C

A pointer to the transform matrix to be applied transposed - the translation elements are presumed zero or irrelevant.

Remarks:
The result in A is equivalent to the following:


BrMatrix34Pre()

Description:
Pre-multiply one matrix by another. Equivalent to the expression:

Declaration:
void BrMatrix34Pre(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the subject matrix (may be same as B).

const br_matrix34 * B

A pointer to the pre-multiplying matrix.

See Also:
BrMatrix34Post()
199, BrMatrix34Mul()188


BrMatrix34PreTranslate()

Description:
Pre-multiply a matrix by a translation transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreTranslate(br_matrix34* mat, br_scalar dx, br_scalar dy, br_scalar dz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar dx

The x axis component used to form the translation matrix.

br_scalar dy

The y axis component used to form the translation matrix.

br_scalar dz

The z axis component used to form the translation matrix.

See Also:
BrMatrix34PostTranslate()
199, BrMatrix34Translate()208


BrMatrix34PreScale()

Description:
Pre-multiply a matrix by a scaling transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreScale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Scaling component along the x axis.

br_scalar sy

Scaling component along the y axis.

br_scalar sz

Scaling component along the z axis.

See Also:
BrMatrix34PostScale()
199, BrMatrix34Scale()208


BrMatrix34PreShearX()

Description:
Pre-multiply a matrix by an x invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreShearX(br_matrix34* mat, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sy

Shear factor by which the x co-ordinate is included in the transformed y co-ordinate.

br_scalar sz

Shear factor by which the x co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PostShearX()
200, BrMatrix34ShearX()209


BrMatrix34PreShearY()

Description:
Pre-multiply a matrix by a y invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreShearY(br_matrix34* mat, br_scalar sx, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Shear factor by which the y co-ordinate is included in the transformed x co-ordinate.

br_scalar sz

Shear factor by which the y co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PostShearY()
201, BrMatrix34ShearY()210


BrMatrix34PreShearZ()

Description:
Pre-multiply a matrix by a z invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreShearY(br_matrix34* mat, br_scalar sx, br_scalar sy)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Shear factor by which the z co-ordinate is included in the transformed x co-ordinate.

br_scalar sy

Shear factor by which the z co-ordinate is included in the transformed y co-ordinate.

See Also:
BrMatrix34PostShearZ()
201, BrMatrix34ShearZ()210


BrMatrix34PreRotate()

Description:
Pre-multiply a matrix by a vector specified axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreRotate(br_matrix34* mat, br_angle r, const br_vector3* axis)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle r

The angle about the specified axis used to form the rotation matrix. A positive angle represents a clockwise rotation (with the vector pointing at you).

const br_vector3*

The arbitrary (normalised) axis vector about which the rotation occurs.

See Also:
BrMatrix34PostRotate()
201, BrMatrix34Rotate()212


BrMatrix34PreRotateX()

Description:
Pre-multiply a matrix by an x axis rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreRotateX(br_matrix34* mat, br_angle rx)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle rx

The angle about the x axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking toward the origin).

See Also:
BrMatrix34PostRotateX()
202, BrMatrix34RotateX()211


BrMatrix34PreRotateY()

Description:
Pre-multiply a matrix by a y axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreRotateY(br_matrix34* mat, br_angle ry)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle ry

The angle about the y axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking towards the origin).

See Also:
BrMatrix34PostRotateY()
202, BrMatrix34RotateY()211


BrMatrix34PreRotateZ()

Description:
Pre-multiply a matrix by a z axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PreRotateZ(br_matrix34* mat, br_angle rz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle rz

The angle about the z axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking towards the origin).

See Also:
BrMatrix34PostRotateZ()
202, BrMatrix34RotateZ()212


BrMatrix34PreTransform()

Description:
Pre-multiply a matrix by a generic transform. Equivalent to the expression:

Declaration:
void BrMatrix34PreTransform(br_matrix34* mat, const br_transform* xform)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

const br_transform * xform

The pre-multiplying generic transform.

Effects:
The transform is first converted to a general 3x4 transform matrix using BrTransformToMatrix34()
343 and then applied as a pre-multiplying matrix using BrMatrix34Pre()194.

See Also:
BrMatrix34PostTransform()203.


BrMatrix34Post()

Description:
Post-multiply one matrix by another. Equivalent to the expression:

Declaration:
void BrMatrix34Post(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the subject matrix (may be same as B).

const br_matrix34 * B

A pointer to the post-multiplying matrix.

See Also:
BrMatrix34Pre()
194, BrMatrix34Mul()188


BrMatrix34PostTranslate()

Description:
Post-multiply a matrix by a translation transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostTranslate(br_matrix34* mat, br_scalar dx, br_scalar dy, br_scalar dz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar dx

The x axis component used to form the translation matrix.

br_scalar dy

The y axis component used to form the translation matrix.

br_scalar dz

The z axis component used to form the translation matrix.

See Also:
BrMatrix34PreTranslate()
194, BrMatrix34Translate()208


BrMatrix34PostScale()

Description:
Post-multiply a matrix by a scaling transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostScale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Scaling component along the x axis.

br_scalar sy

Scaling component along the y axis.

br_scalar sz

Scaling component along the z axis.

See Also:
BrMatrix34PreScale()
195, BrMatrix34Scale()208


BrMatrix34PostShearX()

Description:
Post-multiply a matrix by an x invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostShearX(br_matrix34* mat, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sy

Shear factor by which the x co-ordinate is included in the transformed y co-ordinate.

br_scalar sz

Shear factor by which the x co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PreShearX()
195, BrMatrix34ShearX()209


BrMatrix34PostShearY()

Description:
Post-multiply a matrix by a y invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostShearY(br_matrix34* mat, br_scalar sx, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Shear factor by which the y co-ordinate is included in the transformed x co-ordinate.

br_scalar sz

Shear factor by which the y co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PreShearY()
196, BrMatrix34ShearY()210


BrMatrix34PostShearZ()

Description:
Post-multiply a matrix by a z invariant shearing transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostShearY(br_matrix34* mat, br_scalar sx, br_scalar sy)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_scalar sx

Shear factor by which the z co-ordinate is included in the transformed x co-ordinate.

br_scalar sy

Shear factor by which the z co-ordinate is included in the transformed y co-ordinate.

See Also:
BrMatrix34PreShearZ()
196, BrMatrix34ShearZ()210


BrMatrix34PostRotate()

Description:
Post-multiply a matrix by a vector specified axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostRotate(br_matrix34* mat, br_angle r, const br_vector3* axis)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle r

The angle about the specified axis used to form the rotation matrix.

const br_vector3*

The arbitrary (normalised) axis vector about which the rotation occurs.

See Also:
BrMatrix34PreRotate()
197, BrMatrix34Rotate()212


BrMatrix34PostRotateX()

Description:
Post-multiply a matrix by an x axis rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostRotateX(br_matrix34* mat, br_angle rx)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle rx

The angle about the x axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking towards the origin).

See Also:
BrMatrix34PreRotateX()
197, BrMatrix34RotateX()211


BrMatrix34PostRotateY()

Description:
Post-multiply a matrix by a y axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostRotateY(br_matrix34* mat, br_angle ry)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle ry

The angle about the y axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking towards the origin).

See Also:
BrMatrix34PreRotateY()
197, BrMatrix34RotateY()212


BrMatrix34PostRotateZ()

Description:
Post-multiply a matrix by a z axis, rotational transform matrix. Equivalent to the expression:

Declaration:
void BrMatrix34PostRotateZ(br_matrix34* mat, br_angle rz)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

br_angle rz

The angle about the z axis used to form the rotation matrix. A positive angle represents a clockwise rotation (looking towards the origin).

See Also:
BrMatrix34PreRotateZ()
198, BrMatrix34RotateZ()212


BrMatrix34PostTransform()

Description:
Post-multiply a matrix by a generic transform. Equivalent to the expression:

Declaration:
void BrMatrix34PostTransform(br_matrix34* mat, const br_transform* xform)

Arguments:
br_matrix34 * mat

A pointer to the subject matrix.

const br_transform * xform

The post-multiplying generic transform.

Effects:
The transform is first converted to a general 3x4 transform matrix using BrTransformToMatrix34()
343 and then applied as a post-multiplying matrix using BrMatrix34Post()199.

See Also:
BrMatrix34PreTransform()198.


Conversion

Note that only matrices can represent the full gamut of translation, shearing, reflection, and scaling effects, some of these effects will be lost (or produce undefined behaviour) when converting into another transformation.

From Eulers, Quaternions and Transforms

See BrEulerToMatrix34()
120, BrQuatToMatrix34()314, BrTransformToMatrix34()343.

Also see BrTransformToTransform()343.

To Eulers, Quaternions and Transforms

See BrMatrix34ToEuler()204, BrMatrix34ToQuat()204, BrMatrix34ToTransform()204 as described below.

Also see BrTransformToTransform()343.


BrMatrix34ToEuler()

Description:
Convert a 3D affine matrix to a Euler angle set, that would have the same rotational effect.

Declaration:
br_euler* BrMatrix34ToEuler(br_euler* euler, const br_matrix34* mat)

Arguments:
br_euler * euler

A pointer to the destination Euler angle set to receive the conversion. The Euler angle set's Euler order is used to determine each angle.

const br_matrix34 * mat

A pointer to the source matrix to convert from.

Result:
br_euler *

Returns euler for convenience.

Remarks:
Translation components of the matrix are lost in conversion.


BrMatrix34ToQuat()

Description:
Convert a 3D affine matrix to a quaternion, that would have the same rotational effect.

Declaration:
br_quat* BrMatrix34ToQuat(br_quat* q, const br_matrix34* mat)

Arguments:
br_quat * q

A pointer to the destination quaternion to receive the conversion.

const br_matrix34 * mat

A pointer to the source matrix to convert from.

Result:
br_quat * q

Returns q for convenience.

Remarks:
Translation components of the matrix are lost in conversion.


BrMatrix34ToTransform()

Description:
Convert a 3D affine matrix into a specific transform, that would have a similar transformational effect.

Declaration:
void BrMatrix34ToTransform(br_transform* xform, const br_matrix34* mat)

Arguments:
br_transform * xform

A pointer to the destination transform. The type member of the destination transform is retained and determines the method of conversion.

const br_matrix34 * mat

A pointer to the source matrix to be converted.

Effects:
When the transform is the identity

The destination transform is left unchanged - no conversion necessary.

When the transform is a translation

The translation component of the matrix (its bottom row) is copied into the translation vector of the transform.

When the transform is a Euler angle set

Calls BrMatrix34ToEuler()204 and copies the matrix's translation component (its bottom row) int to the translation vector of the transform.

When the transform is a Look-Up

The Up vector is left unchanged and should really be set before rather than after this conversion.

Copies the third row into the Look vector (if zero (0,0,0) then (0,1,0) is used instead).

The matrix's translation component is copied into the translation vector of the transform.

When the transform is a quaternion

Calls BrMatrix34ToQuat()204 and copies the matrix's translation component (its bottom row) int to the translation vector of the transform.

When the transform is a 3x4 matrix

Directly copies the matrix into the transform.

When the transform is a 3x4 length preserving matrix

Directly copies the matrix into the transform and then calls BrMatrix34LPNormalise()206.


Copy/Assign

Although copy by structure assignment currently works, use BrMatrix34Copy()
205 or BrMatrix34Copy4()206 to ensure compatibility.


BrMatrix34Copy()

Description:
Copy a matrix. Equivalent to the expression:

Declaration:
void BrMatrix34Copy(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the destination matrix (may be the same as source - though redundant).

const br_matrix34 * B

A pointer to the source matrix.


BrMatrix34Copy4()

Description:
Copy a 4x4 matrix into a 3x4 matrix, discarding right-hand column. Equivalent to the expression:

Declaration:
void BrMatrix34Copy4(br_matrix34* A, const br_matrix4* B)

Arguments:
br_matrix34 * A

A pointer to the destination matrix.

const br_matrix4 * B

A pointer to the source 4x4 matrix.

See Also:
BrMatrix4Copy34()
223.


Access & Maintenance

Members may be freely accessed. Maintenance is only required for length preserving matrices that have been modified.


BrMatrix34LPNormalise()

Description:
Normalise a length preserving
*3 matrix. Equivalent to the expression:

Declaration:
void BrMatrix34LPNormalise(br_matrix34* A, const br_matrix34* B)

Arguments:
br_matrix34 * A

A pointer to the destination matrix, which must not point to the source matrix.

const br_matrix34 * B

A pointer to the source matrix.

Effects:
The destination matrix is the source matrix adjusted so that it represents a length preserving transformation.

Remarks:
This function is typically applied to a length preserving matrix which has undergone a long sequence of operations, to ensure that the final matrix is still truly length preserving (regardless of rounding errors).


Referencing & Lifetime

This structure may be freely referenced, though take care if there is potential to supply the same matrix as more than one argument to the same function.

Initialisation

No static initialisers are provided. However, four BR_VECTOR3() macros would serve as well.

All other initialisation should use BrMatrix34Copy()205 or any of the following initialisation functions.


BrMatrix34Identity()

Description:
Set the specified matrix to the identity transformation matrix. Equivalent to:

Declaration:
void BrMatrix34Identity(br_matrix34* mat)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

Effects:
Stores the identity matrix at the destination.


BrMatrix34Translate()

Description:
Set the specified matrix to a matrix representing a specific translation. Equivalent to:

Declaration:
void BrMatrix34Translate(br_matrix34* mat, br_scalar dx, br_scalar dy, br_scalar dz)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_scalar dx

Translation component along the x axis.

br_scalar dy

Translation component along the y axis.

br_scalar dz

Translation component along the z axis.

See Also:
BrMatrix34PreTranslate()
194, BrMatrix34PostTranslate()199.


BrMatrix34Scale()

Description:
Set the specified matrix to a matrix representing a specific scaling. Equivalent to:

Declaration:
void BrMatrix34Scale(br_matrix34* mat, br_scalar sx, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_scalar sx

Scaling component along the x axis.

br_scalar sy

Scaling component along the y axis.

br_scalar sz

Scaling component along the z axis.

See Also:
BrMatrix34PreScale()
195, BrMatrix34PostScale()199.


BrMatrix34ShearX()

Description:
Set the specified matrix to a matrix representing a shear, invariant along the x axis. Thus values of y and z co-ordinates will be scaled in proportion to the value of the x co-ordinate. Equivalent to:

Declaration:
void BrMatrix34ShearX(br_matrix34* mat, br_scalar sy, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_scalar sy

Shear factor by which the x co-ordinate is included in the transformed y co-ordinate.

br_scalar sz

Shear factor by which the x co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PreShearX()
195, BrMatrix34PostShearX()200.


BrMatrix34ShearY()

Description:
Set the specified matrix to a matrix representing a shear, invariant along the y axis. Thus values of x and z co-ordinates will be scaled in proportion to the value of the y co-ordinate. Equivalent to:

Declaration:
void BrMatrix34ShearX(br_matrix34* mat, br_scalar sx, br_scalar sz)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_scalar sx

Shear factor by which the y co-ordinate is included in the transformed x co-ordinate.

br_scalar sz

Shear factor by which the y co-ordinate is included in the transformed z co-ordinate.

See Also:
BrMatrix34PreShearY()
196, BrMatrix34PostShearY()200.


BrMatrix34ShearZ()

Description:
Set the specified matrix to a matrix representing a shear, invariant along the z axis. Thus values of x and y co-ordinates will be scaled in proportion to the value of the z co-ordinate. Equivalent to:

Declaration:
void BrMatrix34ShearX(br_matrix34* mat, br_scalar sx, br_scalar sy)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_scalar sx

Shear factor by which the z co-ordinate is included in the transformed x co-ordinate.

br_scalar sy

Shear factor by which the z co-ordinate is included in the transformed y co-ordinate.

See Also:
BrMatrix34PreShearZ()
196, BrMatrix34PostShearZ()201.


BrMatrix34RotateX()

Description:
Set the specified matrix to a matrix representing a rotation about the x axis though a specified angle. Equivalent to:

Declaration:
void BrMatrix34RotateX(br_matrix34* mat, br_angle rx)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_angle rx

Rotation about the x axis.

See Also:
BrMatrix34PreRotateX()
197, BrMatrix34PostRotateX()202.


BrMatrix34RotateY()

Description:
Set the specified matrix to a matrix representing a rotation about the y axis though a specified angle. Equivalent to:

Declaration:
void BrMatrix34RotateX(br_matrix34* mat, br_angle ry)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_angle ry

Rotation about the y axis.

See Also:
BrMatrix34PreRotateY()
197, BrMatrix34PostRotateY()202.


BrMatrix34RotateZ()

Description:
Set the specified matrix to a matrix representing a rotation about the z axis though a specified angle. Equivalent to:

Declaration:
void BrMatrix34RotateZ(br_matrix34* mat, br_angle rz)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_angle rz

Rotation about the z axis.

See Also:
BrMatrix34PreRotateZ()
198, BrMatrix34PostRotateZ()202.


BrMatrix34Rotate()

Description:
Set the specified matrix to a matrix representing a rotation about a given axis vector though a specified angle. Equivalent to:

Declaration:
void BrMatrix34Rotate(br_matrix34* mat, br_angle r, const br_vector3* a)

Arguments:
br_matrix34 * mat

A pointer to the destination matrix.

br_angle r

Rotation about the specified axis vector.

const br_vector3 * a

The arbitrary (normalised) axis vector about which the rotation occurs.

See Also:
BrMatrix34PreRotate()
197, BrMatrix34PostRotate()201.



Generated with CERN WebMaker