User Tools

Site Tools


DzMatrix3

A 4 x 3 transformation matrix.

More...

Inherits :

Properties

Constructors

DAZ Script
DzMatrix3 ( Boolean initIdentity=false )
DzMatrix3 ( String mtx )
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 )
voidpreRotateX ( Number radians )
voidpreRotateY ( Number radians )
voidpreRotateZ ( Number radians )
voidpreTranslate ( DzVec3 vec )
voidrotate ( DzQuat rot )
voidrotateX ( Number radians )
voidrotateY ( Number radians )
voidrotateZ ( Number radians )
DzVec3row ( Number i )
voidscale ( Number scale, DzVec3 direction, Boolean affectTrans=false )
voidscale ( DzVec3 vec, Boolean affectTrans=false )
voidscale ( Number scale, Boolean affectTrans=false )
voidsetTrans ( DzVec3 vec )
voidshearXY ( Number xShear, Number yShear )
voidshearXZ ( Number xShear, Number zShear )
voidshearYZ ( Number yShear, Number zShear )
StringtoString ()
Numbertrace ()
voidtranslate ( DzVec3 vec )

Detailed Description

A transformation matrix consisting of 4 rows and 3 columns.

Properties


Boolean : isIdentity

Whether or not this matrix is identity


Number : m11

The value of this matrix at [1, 1]


Number : m12

The value of this matrix at [1, 2]


Number : m13

The value of this matrix at [1, 3]


Number : m14

The value of this matrix at [1, 4]


Number : m21

The value of this matrix at [2, 1]


Number : m22

The value of this matrix at [2, 2]


Number : m23

The value of this matrix at [2, 3]


Number : m24

The value of this matrix at [2, 4]


Number : m31

The value of this matrix at [3, 1]


Number : m32

The value of this matrix at [3, 2]


Number : m33

The value of this matrix at [3, 3]


Number : m34

The value of this matrix at [3, 4]

Constructors


DzMatrix3( Boolean initIdentity=false )

Default Constructor.

Parameter(s):

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

DzMatrix3( String mtx )

Creates a 4×3 matrix by parsing a string.

Parameter(s):

  • mtx - A string representation of the 4×3 matrix in the form “[ m11, m21, m31, m12, m22, m32, m13, m23, m33, m14, m24, m34 ]”

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 this matrix at [1, 1]
  • m21 - The value of this matrix at [2, 1]
  • m31 - The value of this matrix at [3, 1]
  • m12 - The value of this matrix at [1, 2]
  • m22 - The value of this matrix at [2, 2]
  • m32 - The value of this matrix at [3, 2]
  • m13 - The value of this matrix at [1, 3]
  • m23 - The value of this matrix at [2, 3]
  • m33 - The value of this matrix at [3, 3]
  • m14 - The value of this matrix at [1, 4]
  • m24 - The value of this matrix at [2, 4]
  • m34 - The value of this 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 this 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.

Parameter(s):

  • rot - The rotation to initialize this 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 this matrix.

Since:

  • 4.9.2.18

DzMatrix3 : inverse()

Return Value:

  • The inverse of this matrix.

void : makeIdentity()

Sets this matrix to be identity.


DzMatrix4 : matrix4()

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 this 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()

Sets the rotation part of this matrix to zero.


void : noScale()

Sets the scale part of this matrix to unity.


void : noTrans()

Sets the translation part of this matrix to zero.


Boolean : orthogonal()

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


void : orthogonalize()

Orthogonalize this matrix.


void : preRotate( DzQuat rot )

Accumulate rotation by pre-multiplying.

Parameter(s):

  • rot - The quaternion at which to rotate.

void : preRotateX( Number radians )

Accumulate rotation around the X axis by pre-multiplying.

Parameter(s):

  • radians - The radians at which to rotate.

void : preRotateY( Number radians )

Accumulate rotation around the Y axis by pre-multiplying.

Parameter(s):

  • radians - The radians at which to rotate.

void : preRotateZ( Number radians )

Accumulate rotation around the Z axis by pre-multiplying.

Parameter(s):

  • radians - The radians at which to rotate.

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).

Parameter(s):

  • rot - The quaternion at which to rotate

void : rotateX( Number radians )

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

Parameter(s):

  • radians - The radians at which to rotate.

void : rotateY( Number radians )

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

Parameter(s):

  • radians - The radians at which to rotate.

void : rotateZ( Number radians )

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

Parameter(s):

  • radians - The radians at which to rotate.

DzVec3 : row( Number i )

Return Value:

  • The i'th row of this matrix.

Since:

  • 4.9.2.18

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 )

TODO: Add description.


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

TODO: Add description.


void : setTrans( DzVec3 vec )

Sets matrix to translate by given vector, leaving rotation as is.

Parameter(s):

  • vec - The point at which to translate.

void : shearXY( Number xShear, Number yShear )

Shears this 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 this 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 this 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

String : toString()

Return Value:

  • A string representation of this matrix in the form “[ m11, m21, m31, m12, m22, m32, m13, m23, m33, m14, m24, m34 ]”.

Number : trace()

Return Value:

  • The trace of this 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.