Matrix3d
class Matrix3d
a 4x4 Matrix3d Object
Constructor
new Matrix3d(args: Matrix3d | number) → {}
Name | Type | Description |
---|---|---|
args | Matrix3d | number |
An instance of me.Matrix3d to copy from, or individual Matrix components (See Matrix3d.setTransform). If not arguments are given, the matrix will be set to Identity. |
Summary
Methods from Matrix3d
Public Properties
Public Methods
apply(v: Vector2d | Vector3d) → {Vector2d | Vector3d}
apply the current transform to the given 2d or 3d vector
applyInverse(v: Vector2d | Vector3d) → {Vector2d | Vector3d}
apply the inverted current transform to the given 2d or 3d vector
copy(m: Matrix3d) → {Matrix3d}
Copies over the values from another me.Matrix3d.
Name | Type | Description |
---|---|---|
m | Matrix3d |
the matrix object to copy from |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
equals(m: Matrix3d) → {boolean}
return true if the two matrices are identical
Name | Type | Description |
---|---|---|
m | Matrix3d |
the other matrix |
Type | Description |
---|---|
boolean |
true if both are equals |
fromMat2d(m: Matrix2d) → {Matrix2d}
Copies over the upper-left 2x2 values from the given me.Matrix2d
Name | Type | Description |
---|---|---|
m | Matrix2d |
the matrix object to copy from |
Type | Description |
---|---|
Matrix2d |
Reference to this object for method chaining |
identity() → {Matrix3d}
reset the transformation matrix to the identity matrix (no transformation).
the identity matrix and parameters position :
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
invert() → {Matrix3d}
invert this matrix, causing it to apply the opposite transformation.
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
isIdentity() → {boolean}
returns true if the matrix is an identity matrix.
Type | Description |
---|---|
boolean |
multiply(m: Matrix3d) → {Matrix3d}
multiply both matrix
Name | Type | Description |
---|---|---|
m | Matrix3d |
Other matrix |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
ortho(left: number, right: number, bottom: number, top: number, near: number, far: number) → {Matrix3d}
generate an orthogonal projection matrix, with the result replacing the current matrix
Name | Type | Description |
---|---|---|
left | number |
farthest left on the x-axis |
right | number |
farthest right on the x-axis |
bottom | number |
farthest down on the y-axis |
top | number |
farthest up on the y-axis |
near | number |
distance to the near clipping plane along the -Z axis |
far | number |
distance to the far clipping plane along the -Z axis |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
rotate(angle: number, v: Vector3d) → {Matrix3d}
rotate this matrix (counter-clockwise) by the specified angle (in radians).
Name | Type | Description |
---|---|---|
angle | number |
Rotation angle in radians. |
v | Vector3d |
the axis to rotate around |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
scale(x: number, y: number, z: number) → {Matrix3d}
scale the matrix
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x | number |
a number representing the abscissa of the scaling vector. |
||
y | number |
<optional> |
x |
a number representing the ordinate of the scaling vector. |
z | number |
<optional> |
0 |
a number representing the depth vector |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
scaleV(v: Vector2d | Vector3d) → {Matrix3d}
adds a 2D scaling transformation.
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
scaleX(x: number) → {Matrix3d}
specifies a 2D scale operation using the [sx, 1] scaling vector
Name | Type | Description |
---|---|---|
x | number |
x scaling vector |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
scaleY(y: number) → {Matrix3d}
specifies a 2D scale operation using the [1,sy] scaling vector
Name | Type | Description |
---|---|---|
y | number |
y scaling vector |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
setTransform(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number) → {Matrix3d}
set the matrix to the specified value
Name | Type | Description |
---|---|---|
m00 | number | |
m01 | number | |
m02 | number | |
m03 | number | |
m10 | number | |
m11 | number | |
m12 | number | |
m13 | number | |
m20 | number | |
m21 | number | |
m22 | number | |
m23 | number | |
m30 | number | |
m31 | number | |
m32 | number | |
m33 | number |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
toArray() → {Float32Array}
return an array representation of this Matrix
Type | Description |
---|---|
Float32Array |
toString() → {string}
convert the object to a string representation
Type | Description |
---|---|
string |
translate(x: number | Vector2d | Vector3d, y: number, z: number) → {Matrix3d}
translate the matrix position using the given vector
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x | number | Vector2d | Vector3d |
a number representing the abscissa of the vector, or a vector object |
||
y | number |
<optional> |
a number representing the ordinate of the vector. |
|
z | number |
<optional> |
0 |
a number representing the depth of the vector |
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |
transpose() → {Matrix3d}
Transpose the value of this matrix.
Type | Description |
---|---|
Matrix3d |
Reference to this object for method chaining |