class flash.geom.Matrix3D

Available on all platforms

The Matrix class represents a transformation matrix that determines how to * map points from one coordinate space to another. You can perform various * graphical transformations on a display object by setting the properties of * a Matrix object, applying that Matrix object to the matrix * property of a Transform object, and then applying that Transform object as * the transform property of the display object. These * transformation functions include translation(x and y * repositioning), rotation, scaling, and skewing. *

Together these types of transformations are known as affine * transformations. Affine transformations preserve the straightness of * lines while transforming, so that parallel lines stay parallel.

*

To apply a transformation matrix to a display object, you create a * Transform object, set its matrix property to the * transformation matrix, and then set the transform property of * the display object to the Transform object. Matrix objects are also used as * parameters of some methods, such as the following:

*
    *
  • The draw() method of a BitmapData object
  • *
  • The beginBitmapFill() method, * beginGradientFill() method, or * lineGradientStyle() method of a Graphics object
  • *
*

A transformation matrix object is a 3 x 3 matrix with the following * contents:

*

In traditional transformation matrixes, the u, * v, and w properties provide extra capabilities. * The Matrix class can only operate in two-dimensional space, so it always * assumes that the property values u and v are 0.0, * and that the property value w is 1.0. The effective values of * the matrix are as follows:

*

You can get and set the values of all six of the other properties in a * Matrix object: a, b, c, * d, tx, and ty.

*

The Matrix class supports the four major types of transformations: * translation, scaling, rotation, and skewing. You can set three of these * transformations by using specialized methods, as described in the following * table:

*

Each transformation function alters the current matrix properties so * that you can effectively combine multiple transformations. To do this, you * call more than one transformation function before applying the matrix to * its display object target(by using the transform property of * that display object).

* *

Use the new Matrix() constructor to create a Matrix object * before you can call the methods of the Matrix object.

Class Fields

static function interpolate(thisMat:Matrix3D, toMat:Matrix3D, percent:Float):Matrix3D

Instance Fields

function new(?v:Vector<Float>):Void

Creates a new Matrix object with the specified parameters. In matrix * notation, the properties are organized like this: *

If you do not provide any parameters to the new Matrix() * constructor, it creates an identity matrix with the following * values:

*

In matrix notation, the identity matrix looks like this:

function append(lhs:Matrix3D):Void

function appendRotation(degrees:Float, axis:Vector3D, ?pivotPoint:Vector3D):Void

function appendScale(xScale:Float, yScale:Float, zScale:Float):Void

function clone():Matrix3D

Returns a new Matrix object that is a clone of this matrix, with an exact * copy of the contained object. * *

returns

A Matrix object.

function copyColumnFrom(column:UInt, vector3D:Vector3D):Void

function copyColumnTo(column:UInt, vector3D:Vector3D):Void

function copyFrom(sourceMatrix3D:Matrix3D):Void

function copyRawDataFrom(vector:Vector<Float>, ?index:UInt, ?transpose:Bool):Void

function copyRawDataTo(vector:Vector<Float>, ?index:UInt, ?transpose:Bool):Void

function copyRowFrom(row:UInt, vector3D:Vector3D):Void

function copyRowTo(row:UInt, vector3D:Vector3D):Void

function decompose(?orientationStyle:Orientation3D):Vector<Vector3D>

function identity():Void

Sets each matrix property to a value that causes a null transformation. An * object transformed by applying an identity matrix will be identical to the * original. *

After calling the identity() method, the resulting matrix * has the following properties: a=1, b=0, * c=0, d=1, tx=0, * ty=0.

*

In matrix notation, the identity matrix looks like this:

function interpolateTo(toMat:Matrix3D, percent:Float):Void

function invert():Bool

Performs the opposite transformation of the original matrix. You can apply * an inverted matrix to an object to undo the transformation performed when * applying the original matrix.

function pointAt(pos:Vector3D, ?at:Vector3D, ?up:Vector3D):Void

function prepend(rhs:Matrix3D):Void

function prependRotation(degrees:Float, axis:Vector3D, ?pivotPoint:Vector3D):Void

function prependScale(xScale:Float, yScale:Float, zScale:Float):Void

function recompose(components:Vector<Vector3D>, ?orientationStyle:Orientation3D):Bool

function transpose():Void