Holomatix

Log In / Register


Purchase
Matrix3d class

Description

The Matrix3d class represents a 4x3 matrix. Such a matrix is used to specify the position and orientation of a scene object.

The matrix looks like this:

      (m00, m01, m02,
      m10, m11, m12,
      m20, m21, m22,
      m30, m31, m32);

Method summary for the Matrix3d class

Method

Description

Matrix3d.inverse() Returns the inverse of this matrix3d
Matrix3d.multiply() Multiplies this matrix3d into a vector3d or another matrix3d and returns the result.
Matrix3d.rotate() Alters the rotation elements of this matrix3d as if rotated around XYZ.
Matrix3d.setRotation() Sets the rotation elements of this matrix3d - m00 to m22.
Matrix3d.setTranslation() Sets the translation elements of this matrix3d - m30, m31 and m32.
Matrix3d.translate() Alters the translation elements of this matrix3d.
Matrix3d.transposeMultiply() Multiplies the transpose of this matrix3d into a vector3d and returns the result.

 

 

 

 

 

 

 

Property summary for the Matrix3d class

The elements of the matrix are known by their position in the matrix:- m00, m01, m02, m10, m11, m12, m20, m21, m22, m30, m31, m32. The first nine entries represent the coordinates of the x, y and z axes of the new system. The final three values represent the x, y and z translations to move the system from the origin.

The above values correspond to:

(xAxis.x, xAxis.y, xAxis.z,
yAxis.x, yAxis.y, yAxis.z,
zAxis.x, zAxis.y, zAxis.z,
translation.x, translation.y, translation.z);

These properties can be set directly.

Constructor for the Matrix3d class

Usage

new Matrix3d();
new Matrix3d(copyMat: Matrix3d);
new Matrix3d(m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number, m20: Number, m21: Number, m22: Number, m30: Number, m31: Number, m32: Number);

Parameters

  • copyMat An optional Matrix3d that will be copied into a new Matrix3d. Defaults to the identity matrix.
  • m00 - m32 The numbers to be assigned to the appropriate members of this Matrix3d.

Returns

A reference to a Matrix3d object

Description

A Matrix3d is generally used as a SceneObject's matrix property, but can be used for more general matrix calculations.

Example

The following creates a matrix3d and stores it as the matrix property of the scene object 'archway':

archway.matrix = new Matrix3d();
 
< Prev   Next >


© Copyright 2000-2011 Holomatix Ltd. All rights reserved.