# ### DAZ Studio 4.x

#### Technical

• # DzMatrix3

A 4 x 3 transformation matrix.

Inherits :

## Constructors

DAZ Script
DzMatrix3 ( Boolean initIdentity=false )
DzMatrix3 ( Number m11, Number m21, Number m31, Number m12, Number m22, Number m32, Number m13, Number m23, Number m33, Number m14, Number m24, Number m34 )
DzMatrix3 ( DzVec3 xAxis, DzVec3 yAxis, DzVec3 zAxis )
DzMatrix3 ( DzQuat rot )
DzMatrix3 ( DzMatrix3 mat )

## Methods

DAZ Script
Numberdet3 ()
DzMatrix3inverse ()
voidmakeIdentity ()
DzMatrix4matrix4 ()
DzMatrix3multiply ( DzMatrix3 mat )
DzVec3multMatrixVec ( DzVec3 vec )
DzVec3multVec ( DzVec3 vec )
voidnoRot ()
voidnoScale ()
voidnoTrans ()
Booleanorthogonal ()
voidorthogonalize ()
voidpreRotate ( DzQuat rot )
voidpreTranslate ( DzVec3 vec )
voidrotate ( DzQuat rot )
DzVec3row ( Number i )
voidscale ( Number scale, Boolean affectTrans=false )
voidscale ( Number scale, DzVec3 direction, Boolean affectTrans=false )
voidscale ( DzVec3 vec, Boolean affectTrans=false )
voidsetTrans ( DzVec3 vec )
voidshearXY ( Number xShear, Number yShear )
voidshearXZ ( Number xShear, Number zShear )
voidshearYZ ( Number yShear, Number zShear )
Numbertrace ()
voidtranslate ( DzVec3 vec )

## Detailed Description

A transformation matrix consisting of 4 rows and 3 columns.

### Properties

Whether or not the matrix is identity

The value of the matrix at [1, 1]

The value of the matrix at [1, 2]

The value of the matrix at [1, 3]

The value of the matrix at [1, 4]

The value of the matrix at [2, 1]

The value of the matrix at [2, 2]

The value of the matrix at [2, 3]

The value of the matrix at [2, 4]

The value of the matrix at [3, 1]

The value of the matrix at [3, 2]

The value of the matrix at [3, 3]

The value of the matrix at [3, 4]

### Constructors

DzMatrix3( Boolean initIdentity=false )

Default Constructor.

Parameter(s):

• initIdentity - If `true`, the matrix will be set to the identity matrix, otherwise, the matrix values will be indeterminate.

DzMatrix3( Number m11, Number m21, Number m31, Number m12, Number m22, Number m32, Number m13, Number m23, Number m33, Number m14, Number m24, Number m34 )

Constructs a 4×3 matrix from 12 elements in “Column Major” order.

Parameter(s):

• m11 - The value of the matrix at [1, 1]
• m21 - The value of the matrix at [2, 1]
• m31 - The value of the matrix at [3, 1]
• m12 - The value of the matrix at [1, 2]
• m22 - The value of the matrix at [2, 2]
• m32 - The value of the matrix at [3, 2]
• m13 - The value of the matrix at [1, 3]
• m23 - The value of the matrix at [2, 3]
• m33 - The value of the matrix at [3, 3]
• m14 - The value of the matrix at [1, 4]
• m24 - The value of the matrix at [2, 4]
• m34 - The value of the matrix at [3, 4]

Example:

```// Create a new 4x3 matrix
var mtx3 = new DzMatrix3( 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 );
// Print the input sequence, for comparison
print( 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 );
// Print elements of the matrix in column major order
print(
mtx3.m11, mtx3.m21, mtx3.m31,
mtx3.m12, mtx3.m22, mtx3.m32,
mtx3.m13, mtx3.m23, mtx3.m33,
mtx3.m14, mtx3.m24, mtx3.m34 );```

DzMatrix3( DzVec3 xAxis, DzVec3 yAxis, DzVec3 zAxis )

Constructor from three axes of the rotation coord system. These are assumed to be (but do not have to be if a sheared or warped coord system is desired) to be orthogonal unit vectors.

Since:

• 4.6.4.98

DzMatrix3( DzQuat rot )

Constructs a 4×3 matrix from a quaternion. Initializes the matrix to the given rotation.

Parameter(s):

• rot - The rotation to initialize the matrix to.

Since:

• 4.6.4.98

DzMatrix3( DzMatrix3 mat )

Copy Constructor.

Parameter(s):

• mat - The matrix to copy.

### Methods

Number : det3()

Return Value:

• The determinant of the upper 3×3 part of the matrix.

Since:

• 4.9.2.18

DzMatrix3 : inverse()

Return Value:

• The inverse of the matrix.

void : makeIdentity()

Sets the matrix to be identity

Return Value:

• this matrix as a 4×4 matrix

Since:

• 4.9.2.18

DzMatrix3 : multiply( DzMatrix3 mat )

Calculates the multiplication of this matrix by the given matrix.

Parameter(s):

• mat - The matrix to multiply by

Return Value:

• The result of the multiplication

DzVec3 : multMatrixVec( DzVec3 vec )

Multiplies matrix by given column vector, giving column vector result

Parameter(s):

• vec - The vector to multiplying this matrix by

Return Value:

• The result of multiplying the given vector through this matrix

DzVec3 : multVec( DzVec3 vec )

Transforms the given vector through this matrix.

Parameter(s):

• vec - The vector to transform through this matrix

Since:

• 4.9.2.18

void : noRot()

Zero rotation part of the matrix.

void : noScale()

Set scale to unity.

void : noTrans()

Zero translation part of the matrix.

Test for orthogonal 3×3 sub-matrix (orthonormal rows)

void : orthogonalize()

Orthogonalize the matrix.

void : preRotate( DzQuat rot )

Accumulate rotation by pre-multiplying.

void : preRotateX( Number radians )

Accumulate rotation around the X axis by pre-multiplying.

void : preRotateY( Number radians )

Accumulate rotation around the Y axis by pre-multiplying.

void : preRotateZ( Number radians )

Accumulate rotation around the Z axis by pre-multiplying.

void : preTranslate( DzVec3 vec )

Accumulate a translation by pre-multiplying.

Parameter(s):

• vec - The point at which to translate

void : rotate( DzQuat rot )

Accumulate rotation (by post-multiplying).

void : rotateX( Number radians )

Accumulate rotation around the X axis (by post-multiplying).

void : rotateY( Number radians )

Accumulate rotation around the Y axis (by post-multiplying).

void : rotateZ( Number radians )

Accumulate rotation around the Z axis (by post-multiplying).

DzVec3 : row( Number i )

Return Value:

• The i'th row of the matrix.

Since:

• 4.9.2.18

void : scale( Number scale, Boolean affectTrans=false )

void : scale( Number scale, DzVec3 direction, Boolean affectTrans=false )

Accumulates a scale along an arbitrary axis (by post-multiplying).

Parameter(s):

• scale - The scale to apply
• dir - The direction to scale
• affectTrans - Whether or not to affect the transform rows

Since:

• 4.9.2.18

void : scale( DzVec3 vec, Boolean affectTrans=false )

void : setTrans( DzVec3 vec )

Set translation part.

Parameter(s):

• vec - The point to use for translation

void : shearXY( Number xShear, Number yShear )

Shears the matrix along the x and y axis (by post-multiplying).

Parameter(s):

• xShear - The value to shear along the x axis
• yShear - The value to shear along the y axis

Since:

• 4.9.2.18

void : shearXZ( Number xShear, Number zShear )

Shears the matrix along the x and z axis (by post-multiplying).

Parameter(s):

• xShear - The value to shear along the x axis
• zShear - The value to shear along the z axis

Since:

• 4.9.2.18

void : shearYZ( Number yShear, Number zShear )

Shears the matrix along the y and z axis (by post-multiplying).

Parameter(s):

• yShear - The value to shear along the y axis
• zShear - The value to shear along the z axis

Since:

• 4.9.2.18

Number : trace()

Return Value:

• The trace of the matrix

Since:

• 4.9.2.18

void : translate( DzVec3 vec )

Accumulate a translation (by post-multiplying).

Parameter(s):

• vec - The point at which to translate

### Page Tools 