| Package | alternativa.types |
| Class | public final class Matrix3D |
a b c d |
e f g h |
i j k l |
0 0 0 1 |
To transform coordinate (x, y, z) through the matrix, the following formulas are being used:
x' = ax + by + cz + d |
y' = ex + fy + gz + h |
z' = ix + jy + kz + l |
From applying transformation to a three-dimentional object point of view, matrix may be understood as an order of scaling and rotating object in a local coordinates system, and then offsetting zero local point in a parental coordinate system. So, matrix
a b c |
e f g |
i j k |
(d, h, l) as a center of an object or matrix.
| Property | Defined by | ||
|---|---|---|---|
| a : Number | Matrix3D | ||
| b : Number | Matrix3D | ||
| c : Number | Matrix3D | ||
| d : Number | Matrix3D | ||
| e : Number | Matrix3D | ||
| f : Number | Matrix3D | ||
| g : Number | Matrix3D | ||
| h : Number | Matrix3D | ||
| i : Number | Matrix3D | ||
| j : Number | Matrix3D | ||
| k : Number | Matrix3D | ||
| l : Number | Matrix3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Matrix3D(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 0, e:Number = 0, f:Number = 1, g:Number = 0, h:Number = 0, i:Number = 0, j:Number = 0, k:Number = 1, l:Number = 0)
Create matrix instance.
| Matrix3D | ||
|
Adds a matrix to the current one.
| Matrix3D | ||
|
[static]The method creates a matrix for rotation given in axis-angle form.
| Matrix3D | ||
|
Clone matrix.
| Matrix3D | ||
|
Multiply on a matrix from the right (inherit the transformation from the matrix).
| Matrix3D | ||
|
Copy values of the given matrix.
| Matrix3D | ||
|
Transforms the given vector not using translation part of the matrix.
| Matrix3D | ||
|
Compare matrices with a given treshold.
| Matrix3D | ||
|
fromAxisAngle(axis:Point3D, angle:Number = 0):void
The method creates a matrix for rotation given in axis-angle form.
| Matrix3D | ||
|
The method extracts rotation angles from given rotation matrix.
| Matrix3D | ||
|
inverseCombine(matrix:Matrix3D):void
Multiply on a matrix from the left (apply own transformation to the the matrix).
| Matrix3D | ||
|
[static]Get inverse matrix.
| Matrix3D | ||
|
inverseRotate(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):void
Inverse matrix rotate.
| Matrix3D | ||
|
inverseRotationMatrix(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):Matrix3D
[static]Get inverse rotation matrix.
| Matrix3D | ||
|
inverseScale(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):void
Inverce matrix scale.
| Matrix3D | ||
|
inverseScaleMatrix(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3D
[static]Get inverse scale matrix.
| Matrix3D | ||
|
inverseTransform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):void
Inverse matrix transformation.
| Matrix3D | ||
|
inverseTransformationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3D
[static]Get inverse transformation matrix.
| Matrix3D | ||
|
inverseTranslate(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):void
Inverse matrix center offset.
| Matrix3D | ||
|
inverseTranslationMatrix(x:Number = 0, y:Number = 0, z:Number = 0):Matrix3D
[static]Get inverse offset matrix.
| Matrix3D | ||
|
invert():void
Invert matrix.
| Matrix3D | ||
|
multByScalar(multiplier:Number):void
Multimplies the matrix by the given scalar.
| Matrix3D | ||
|
offset(x:Number = 0, y:Number = 0, z:Number = 0):void
Set matrix center.
| Matrix3D | ||
|
[static]Matrix multiply.
| Matrix3D | ||
|
rotate(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):void
Matrix rotation.
| Matrix3D | ||
|
rotationMatrix(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):Matrix3D
[static]Get rotation matrix.
| Matrix3D | ||
|
scale(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):void
Matrix scale.
| Matrix3D | ||
|
scaleMatrix(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3D
[static]Get scale matrix.
| Matrix3D | ||
|
toIdentity():void
Reduction matrix to a unitary matrix.
| Matrix3D | ||
|
toString():String
String matrix representation.
| Matrix3D | ||
|
toTransform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):void
Form transformation matrix.
| Matrix3D | ||
|
transform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):void
Matrix transformation.
| Matrix3D | ||
|
transformationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3D
[static]Get transformation matrix.
| Matrix3D | ||
|
translate(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):void
Matrix center translation.
| Matrix3D | ||
|
translateLocal(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):void
Matrix center translation in local coordinates.
| Matrix3D | ||
|
translationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):Matrix3D
[static]Get translation matrix.
| Matrix3D | ||
|
transpose():void
Transposes the matrix.
| Matrix3D | ||
| a | property |
public var a:Number
| b | property |
public var b:Number
| c | property |
public var c:Number
| d | property |
public var d:Number
| e | property |
public var e:Number
| f | property |
public var f:Number
| g | property |
public var g:Number
| h | property |
public var h:Number
| i | property |
public var i:Number
| j | property |
public var j:Number
| k | property |
public var k:Number
| l | property |
public var l:Number
| Matrix3D | () | constructor |
public function Matrix3D(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 0, e:Number = 0, f:Number = 1, g:Number = 0, h:Number = 0, i:Number = 0, j:Number = 0, k:Number = 1, l:Number = 0)Create matrix instance.
Parametersa:Number (default = 1) |
|
b:Number (default = 0) |
|
c:Number (default = 0) |
|
d:Number (default = 0) |
|
e:Number (default = 0) |
|
f:Number (default = 1) |
|
g:Number (default = 0) |
|
h:Number (default = 0) |
|
i:Number (default = 0) |
|
j:Number (default = 0) |
|
k:Number (default = 1) |
|
l:Number (default = 0) |
| add | () | method |
public function add(m:Matrix3D):voidAdds a matrix to the current one.
Parametersm:Matrix3D — the matrix which is being added |
| axisAngleToMatrix | () | method |
public static function axisAngleToMatrix(axis:Point3D, angle:Number = 0):Matrix3DThe method creates a matrix for rotation given in axis-angle form.
Parametersaxis:Point3D — unit vector of the rotation axis |
|
angle:Number (default = 0) — the angle of rotation in radians |
Matrix3D — rotation matrix |
| clone | () | method |
| combine | () | method |
public function combine(matrix:Matrix3D):voidMultiply on a matrix from the right (inherit the transformation from the matrix).
Parametersmatrix:Matrix3D — matrix which is being used for transformation inheritance. Left multiply operand. |
| copy | () | method |
public function copy(matrix:Matrix3D):voidCopy values of the given matrix.
Parametersmatrix:Matrix3D — matrix, which values are being copied |
| deltaTransformVector | () | method |
public function deltaTransformVector(pin:Point3D, pout:Point3D):voidTransforms the given vector not using translation part of the matrix.
Parameterspin:Point3D — input vector |
|
pout:Point3D — output vector |
| equals | () | method |
public function equals(matrix:Matrix3D, threshold:Number = 0):BooleanCompare matrices with a given treshold.
Parametersmatrix:Matrix3D — matrix to compare |
|
threshold:Number (default = 0) — comparison threshold |
Boolean — true if absolute difference of any corresponding elements of the matrices isn't greater than given threshold, otherwise false |
| fromAxisAngle | () | method |
public function fromAxisAngle(axis:Point3D, angle:Number = 0):voidThe method creates a matrix for rotation given in axis-angle form.
Parametersaxis:Point3D — unit vector of the rotation axis |
|
angle:Number (default = 0) — the angle of rotation in radians |
| getRotations | () | method |
public function getRotations(rotations:Point3D = null):Point3DThe method extracts rotation angles from given rotation matrix.
Parametersrotations:Point3D (default = null) — if parameter is not null, the result will be stored here |
Point3D — rotation angles |
| inverseCombine | () | method |
public function inverseCombine(matrix:Matrix3D):voidMultiply on a matrix from the left (apply own transformation to the the matrix).
Parametersmatrix:Matrix3D — matrix which current matrix transformation is being applied to. Right multiply operand. |
| inverseMatrix | () | method |
public static function inverseMatrix(matrix:Matrix3D):Matrix3DGet inverse matrix.
Parametersmatrix:Matrix3D — matrix for which inverse is being calculated |
Matrix3D — inverse matrix |
| inverseRotate | () | method |
public function inverseRotate(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):voidInverse matrix rotate. The result of multiply from the right on the matrix Rx-1 × Ry-1 × Rz-1, где Rx, Ry, Rz — matrix rotate relative to corresponding parent coordinates system axes.
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
| inverseRotationMatrix | () | method |
public static function inverseRotationMatrix(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):Matrix3DGet inverse rotation matrix. Matrix is a muliply like Rx-1 × Ry-1 × Rz-1.
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
Matrix3D — inverse rotation matrix |
| inverseScale | () | method |
public function inverseScale(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):voidInverce matrix scale.
ParametersscaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
| inverseScaleMatrix | () | method |
public static function inverseScaleMatrix(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3DGet inverse scale matrix.
ParametersscaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
Matrix3D — inverse scaling matrix |
| inverseTransform | () | method |
public function inverseTransform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):voidInverse matrix transformation. Matrix multiplying product S-1 × Rx-1 × Ry-1 × Rz-1 × T-1 × M, where Т — translation matrix, S — scale matrix, Rx, Ry, Rz — rotation matrices (around corresponding parental coordinate system axes).
deltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
|
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
|
scaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
| inverseTransformationMatrix | () | method |
public static function inverseTransformationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3DGet inverse transformation matrix. Matrix multiplying product S-1 × Rx-1 × Ry-1 × Rz-1 × T-1, where Т — translation matrix, S — scale matrix, Rx, Ry, Rz — rotation matrices (around corresponding parental coordinate system axes).
deltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
|
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
|
scaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
Matrix3D — inverse transformation matrix |
| inverseTranslate | () | method |
public function inverseTranslate(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):voidInverse matrix center offset.
ParametersdeltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
| inverseTranslationMatrix | () | method |
public static function inverseTranslationMatrix(x:Number = 0, y:Number = 0, z:Number = 0):Matrix3DGet inverse offset matrix.
Parametersx:Number (default = 0) — X axis offset |
|
y:Number (default = 0) — Y axis offset |
|
z:Number (default = 0) — Z axis offset |
Matrix3D — inverse translation matrix |
| invert | () | method |
public function invert():voidInvert matrix.
| multByScalar | () | method |
public function multByScalar(multiplier:Number):voidMultimplies the matrix by the given scalar.
Parametersmultiplier:Number — multuplier |
| offset | () | method |
public function offset(x:Number = 0, y:Number = 0, z:Number = 0):voidSet matrix center.
Parametersx:Number (default = 0) — matrix center X coordinate |
|
y:Number (default = 0) — matrix center Y coordinate |
|
z:Number (default = 0) — matrix center Z coordinate |
| product | () | method |
public static function product(m1:Matrix3D, m2:Matrix3D):Matrix3DMatrix multiply.
Parametersm1:Matrix3D — parent transformation matrix. Left multiply operand. |
|
m2:Matrix3D — child transformation matrix. Right multiply operand. |
Matrix3D — product of the matrix |
| rotate | () | method |
public function rotate(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):voidMatrix rotation. Matrix multiplying product Rz × Ry × Rx × M, where Rx, Ry, Rz — rotation matrices (around corresponding parental coordinate system axes).
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
| rotationMatrix | () | method |
public static function rotationMatrix(rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0):Matrix3DGet rotation matrix. Matrix multiply product like Rz × Ry × Rx.
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
Matrix3D — rotation matrix |
| scale | () | method |
public function scale(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):voidMatrix scale.
ParametersscaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
| scaleMatrix | () | method |
public static function scaleMatrix(scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3DGet scale matrix.
ParametersscaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
Matrix3D — a scale matrix |
| toIdentity | () | method |
public function toIdentity():voidReduction matrix to a unitary matrix.
| toString | () | method |
public function toString():StringString matrix representation.
ReturnsString — a formatted string with values of the matrix |
| toTransform | () | method |
public function toTransform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):voidForm transformation matrix. Matrix multiplying product T × Rz × Ry × Rx × S, where Т — translation matrix, S — scale matrix, Rx, Ry, Rz — rotation matrix (around corresponding parental coordinate system axes).
deltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
|
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
|
scaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
| transform | () | method |
public function transform(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):voidMatrix transformation. Matrix multiplying product T × Rz × Ry × Rx × S × M. Here Т — translation matrix, Rx, Ry, Rz — rotation matrices (around corresponding parental coordinate system axes), S — scale matrix.
deltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
|
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
|
scaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
| transformationMatrix | () | method |
public static function transformationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1):Matrix3DGet transformation matrix. Matrix multiplying product T × Rz × Ry × Rx × S, where Т — translation matrix, S — scale matrix, Rx, Ry, Rz — rotation matrices (around corresponding parental coordinate system axes).
deltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
|
rotationX:Number (default = 0) — rotation around X axis in radians |
|
rotationY:Number (default = 0) — rotation around Y axis in radians |
|
rotationZ:Number (default = 0) — rotation around Z axis in radians |
|
scaleX:Number (default = 1) — X axis scale coefficient |
|
scaleY:Number (default = 1) — Y axis scale coefficient |
|
scaleZ:Number (default = 1) — Z axis scale coefficient |
Matrix3D |
| translate | () | method |
public function translate(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):voidMatrix center translation.
ParametersdeltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
| translateLocal | () | method |
public function translateLocal(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):voidMatrix center translation in local coordinates.
ParametersdeltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
| translationMatrix | () | method |
public static function translationMatrix(deltaX:Number = 0, deltaY:Number = 0, deltaZ:Number = 0):Matrix3DGet translation matrix.
ParametersdeltaX:Number (default = 0) — X axis offset |
|
deltaY:Number (default = 0) — Y axis offset |
|
deltaZ:Number (default = 0) — Z axis offset |
Matrix3D — translation matrix |
| transpose | () | method |
public function transpose():voidTransposes the matrix.