You are here: Home » Public » Software » Daz Studio » v4.x » Reference Guide » Scripting » API Reference » Object Index » DzMatrix4

DAZ Script |
---|

DzMatrix4 ( Boolean initIdentity=false ) |

DzMatrix4 ( Number m11, Number m21, Number m31, Number m41, Number m12, Number m22, Number m32, Number m42, Number m13, Number m23, Number m33, Number m43, Number m14, Number m24, Number m34, Number m44 ) |

DzMatrix4 ( DzVec3 xAxis, DzVec3 yAxis, DzVec3 zAxis ) |

DzMatrix4 ( DzQuat rot ) |

DzMatrix4 ( DzMatrix4 mat ) |

DAZ Script | |
---|---|

DzMatrix4 | inverse () |

void | invert () |

void | makeIdentity () |

DzMatrix3 | matrix3 () |

DzMatrix4 | multiply ( DzMatrix4 mat ) |

DzVec3 | multMatrixVec ( DzVec3 vec ) |

DzVec3 | multVecMatrix ( DzVec3 vec ) |

Boolean | orthogonal () |

void | preScale ( Number scale ) |

void | preScale ( DzVec3 vec ) |

void | preScale ( Number scale, DzVec3 direction ) |

void | preShearXY ( Number xShear, Number yShear ) |

void | preShearXZ ( Number xShear, Number zShear ) |

void | preShearYZ ( Number yShear, Number zShear ) |

void | preTranslate ( DzVec3 vec ) |

void | rotate ( DzQuat rot ) |

void | rotateX ( Number radians ) |

void | rotateY ( Number radians ) |

void | rotateZ ( Number radians ) |

DzVec3 | row ( Number i ) |

void | scale ( DzVec3 vec ) |

void | scale ( Number scale ) |

void | scale ( Number scale, DzVec3 direction ) |

void | setRow ( Number i, DzVec3 vec ) |

void | setTrans ( DzVec3 vec ) |

void | shearXY ( Number xShear, Number yShear ) |

void | shearXZ ( Number xShear, Number zShear ) |

void | shearYZ ( Number yShear, Number zShear ) |

Number | trace () |

void | translate ( DzVec3 vec ) |

DzMatrix4 | transpose () |

A transformation matrix consisting of 4 rows and 4 columns.

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]

The value of the matrix at [4, 1]

The value of the matrix at [4, 2]

The value of the matrix at [4, 3]

The value of the matrix at [4, 4]

**DzMatrix4**( 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.

**DzMatrix4**( Number m11, Number m21, Number m31, Number m41, Number m12, Number m22, Number m32, Number m42, Number m13, Number m23, Number m33, Number m43, Number m14, Number m24, Number m34, Number m44 )

Constructs a 4×4 matrix from 16 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]*m41*- The value of the matrix at [4, 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]*m42*- The value of the matrix at [4, 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]*m43*- The value of the matrix at [4, 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]*m44*- The value of the matrix at [4, 4]

**Example:**

// Create a new 4x4 matrix var mtx4 = new DzMatrix4( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ); // Print the input sequence, for comparison print( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ); // Print elements of the matrix in column major order print( mtx4.m11, mtx4.m21, mtx4.m31, mtx4.m41, mtx4.m12, mtx4.m22, mtx4.m32, mtx4.m42, mtx4.m13, mtx4.m23, mtx4.m33, mtx4.m43, mtx4.m14, mtx4.m24, mtx4.m34, mtx4.m44 );

**DzMatrix4**( 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

Constructs a 4×4 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

**DzMatrix4**( *DzMatrix4* mat )

Copy Constructor.

**Parameter(s):**

*mat*- The matrix to copy.

*DzMatrix4* : **inverse**()

**Return Value:**

- The inverse of the matrix.

void : **invert**()

Test and choose best inverse for current matrix

**Since:**

- 4.9.2.18

void : **makeIdentity**()

Sets the matrix to be identity

**Return Value:**

- The value of this matrix as a DzMatrix3.

**Since:**

- 4.9.2.18

*DzMatrix4* : **multiply**( *DzMatrix4* 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 : **multVecMatrix**( DzVec3 vec )

Multiplies given row vector by matrix, giving row vector result

**Parameter(s):**

*src*- The vector to multiplying this matrix by

**Return Value:**

- The result of multiplying the given vector through this matrix

Boolean : **orthogonal**()

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

**Since:**

- 4.6.4.98

void : **preScale**( Number scale )

Accumulates a uniform scale by pre-multiplying.

Accumulates a general scale by pre-multiplying.

**Parameter(s):**

*scale*- The scale to use

void : **preScale**( Number scale, DzVec3 direction )

Accumulates a scale along an arbitrary axis by pre-multiplying.

**Since:**

- 4.9.2.18

void : **preShearXY**( Number xShear, Number yShear )

Shears the matrix along the x and y axis (by pre-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 : **preShearXZ**( Number xShear, Number zShear )

Shears the matrix along the x and z axis (by pre-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 : **preShearYZ**( Number yShear, Number zShear )

Shears the matrix along the y and z axis (by pre-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

void : **preTranslate**( DzVec3 vec )

Accumulate a translation by pre-multiplying.

**Parameter(s):**

*vec*- The point at which to translate

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

**Return Value:**

- The first three elements of the i'th row of the matrix.

**Since:**

- 4.9.2.18

Accumulates a general scale (by post-multiplying).

Accumulates a uniform scale (by post-multiplying).

void : **scale**( Number scale, DzVec3 direction )

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

**Since:**

- 4.9.2.18

void : **setRow**( Number i, DzVec3 vec )

**TODO:**
Add description.

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

**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

*DzMatrix4* : **transpose**()

**Return Value:**

- The transpose of the matrix.

**Since:**

- 4.9.2.18

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 3.0 Unported