Class: Transform3D
A 3D affine transformation. By default, Transform3D objects are initially created as identity transformations.
Constructors
constructor
• new Transform3D(): Transform3D
Returns
Methods
addRotation
▸ addRotation(theta
, axisX
, axisY
, axisZ
, order?
): this
Adds a rotation about an arbitrary axis passing through the origin (0, 0, 0) to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:705
▸ addRotation(theta
, axisX
, axisY
, axisZ
, originX
, originY
, originZ
, order?
): this
Adds a rotation about an arbitrary axis passing through an arbitrary point to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:719
addRotationX
▸ addRotationX(theta
, order?
): this
Adds a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0) to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:573
▸ addRotationX(theta
, originX
, originY
, originZ
, order?
): this
Adds a rotation about an axis parallel to the x axis passing through an arbitrary point to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:584
addRotationY
▸ addRotationY(theta
, order?
): this
Adds a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0) to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:616
▸ addRotationY(theta
, originX
, originY
, originZ
, order?
): this
Adds a rotation about an axis parallel to the y axis passing through an arbitrary point to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:627
addRotationZ
▸ addRotationZ(theta
, order?
): this
Adds a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0) to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:659
▸ addRotationZ(theta
, originX
, originY
, originZ
, order?
): this
Adds a rotation about an axis parallel to the z axis passing through an arbitrary point to this transformation.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
order? | "after" | "before" | The order in which to add the rotation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:670
addScale
▸ addScale(x
, y
, z
, order?
): this
Adds a scaling about the origin (0, 0, 0) to this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
order? | "after" | "before" | The order in which to add the scaling, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:528
▸ addScale(x
, y
, z
, originX
, originY
, originZ
, order?
): this
Adds a scaling about an arbitrary origin to this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
originX | number | The x-coordinate of the scaling origin. |
originY | number | The y-coordinate of the scaling origin. |
originZ | number | The z-coordinate of the scaling origin. |
order? | "after" | "before" | The order in which to add the scaling, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:541
addTranslation
▸ addTranslation(x
, y
, z
, order?
): this
Adds a translation to this transformation.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
x | number | undefined | The x translation. |
y | number | undefined | The y translation. |
z | number | undefined | The z translation. |
order | "after" | "before" | 'after' | The order in which to add the translation, relative to this existing transformation, either 'before' or 'after' . Defaults to 'after' . |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:507
apply
▸ apply(vec
, out
): Float64Array
Applies this transformation to a 3D vector.
Parameters
Name | Type | Description |
---|---|---|
vec | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | A 3D vector. |
out | Float64Array | The vector to which to write the result. |
Returns
Float64Array
The result of applying this transformation to vec
.
Defined in
src/sdk/math/Transform3D.ts:294
copy
▸ copy(): Transform3D
Copies this transformation.
Returns
A copy of this transformation.
Defined in
src/sdk/math/Transform3D.ts:284
getParameters
▸ getParameters(): Readonly
<Float64Array
>
Gets the parameters of this transformation as a 12-tuple:
[scaleX, skewX(Y), skewX(Z), translateX, skewY(X), scaleY, skewY(Z), translateY, skewZ(X), skewZ(Y), scaleZ, translateZ]
.
Returns
Readonly
<Float64Array
>
The parameters of this transformation.
Defined in
src/sdk/math/Transform3D.ts:21
invert
▸ invert(): this
Inverts this transformation.
Returns
this
This transformation, after it has been inverted.
Throws
Error if this transformation cannot be inverted.
Defined in
src/sdk/math/Transform3D.ts:225
offsetOrigin
▸ offsetOrigin(x
, y
, z
): this
Changes this transformation to the one that is the result of offsetting this transformation's origin.
Parameters
Name | Type | Description |
---|---|---|
x | number | The x-coordinate of the offset origin. |
y | number | The y-coordinate of the offset origin. |
z | number | The z-coordinate of the offset origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:312
set
▸ set(scaleX
, skewXY
, skewXZ
, translateX
, skewYX
, scaleY
, skewYZ
, translateY
, skewZX
, skewZY
, scaleZ
, translateZ
): this
Sets the parameters of this transformation.
Parameters
Name | Type | Description |
---|---|---|
scaleX | number | The x scaling factor. |
skewXY | number | The x skew factor along the y axis. |
skewXZ | number | The x skew factor along the z axis. |
translateX | number | The x translation. |
skewYX | number | The y skew factor along the x axis. |
scaleY | number | The y scaling factor. |
skewYZ | number | The y skew factor along the z axis. |
translateY | number | The y translation. |
skewZX | number | The z skew factor along the x axis. |
skewZY | number | The z skew factor along the y axis. |
scaleZ | number | The z scaling factor. |
translateZ | number | The z translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:41
▸ set(transform
): this
Sets the parameters of this transformation from another transformation.
Parameters
Name | Type | Description |
---|---|---|
transform | ReadonlyTransform3D | The transformation from which to take parameters. |
Returns
this
Defined in
src/sdk/math/Transform3D.ts:59
setScale
▸ setScale(x
, y
, z
): this
Sets the x and y scaling factors of this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The new x scaling factor. |
y | number | The new y scaling factor. |
z | number | The new z scaling factor. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:133
setScaleX
▸ setScaleX(value
): this
Sets the x scaling factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new x scaling factor. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:101
setScaleY
▸ setScaleY(value
): this
Sets the y scaling factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new y scaling factor. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:111
setScaleZ
▸ setScaleZ(value
): this
Sets the z scaling factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new z scaling factor. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:121
setSkewX
▸ setSkewX(y
, z
): this
Sets the x skew factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
y | number | The new x skew factor along the y axis. |
z | number | The new x skew factor along the z axis. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:146
setSkewY
▸ setSkewY(x
, z
): this
Sets the y skew factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The new y skew factor along the x axis. |
z | number | The new y skew factor along the z axis. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:158
setSkewZ
▸ setSkewZ(x
, y
): this
Sets the z skew factor of this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The new z skew factor along the x axis. |
y | number | The new z skew factor along the y axis. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:170
setTranslate
▸ setTranslate(x
, y
, z
): this
Sets the x and y translations of this transformation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The new x translation. |
y | number | The new y translation. |
z | number | The new z translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:213
setTranslateX
▸ setTranslateX(value
): this
Sets the x translation of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new x translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:181
setTranslateY
▸ setTranslateY(value
): this
Sets the y translation of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new y translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:191
setTranslateZ
▸ setTranslateZ(value
): this
Sets the z translation of this transformation.
Parameters
Name | Type | Description |
---|---|---|
value | number | The new z translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:201
toIdentity
▸ toIdentity(): this
Sets this transformation to the identity transformation.
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:324
toRotation
▸ toRotation(theta
, axisX
, axisY
, axisZ
): this
Sets this transformation to a rotation about an arbitrary axis passing through the origin (0, 0, 0).
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:456
▸ toRotation(theta
, axisX
, axisY
, axisZ
, originX
, originY
, originZ
): this
Sets this transformation to a rotation about an arbitrary axis passing through an arbitrary point.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
axisX | number | The x component of the vector defining the direction of the rotation axis. |
axisY | number | The y component of the vector defining the direction of the rotation axis. |
axisZ | number | The z component of the vector defining the direction of the rotation axis. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:468
toRotationX
▸ toRotationX(theta
): this
Sets this transformation to a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0).
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:372
▸ toRotationX(theta
, originX
, originY
, originZ
): this
Sets this transformation to a rotation about an axis parallel to the x axis passing through an arbitrary point.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:381
toRotationY
▸ toRotationY(theta
): this
Sets this transformation to a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0).
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:399
▸ toRotationY(theta
, originX
, originY
, originZ
): this
Sets this transformation to a rotation about an axis parallel to the y axis passing through an arbitrary point.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:408
toRotationZ
▸ toRotationZ(theta
): this
Sets this transformation to a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0).
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:426
▸ toRotationZ(theta
, originX
, originY
, originZ
): this
Sets this transformation to a rotation about an axis parallel to the z axis passing through an arbitrary point.
Parameters
Name | Type | Description |
---|---|---|
theta | number | The rotation angle, in radians. |
originX | number | The x-coordinate of the rotation origin. |
originY | number | The y-coordinate of the rotation origin. |
originZ | number | The z-coordinate of the rotation origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:435
toScale
▸ toScale(x
, y
, z
): this
Sets this transformation to a scaling about the origin (0, 0, 0).
Parameters
Name | Type | Description |
---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:346
▸ toScale(x
, y
, z
, originX
, originY
, originZ
): this
Sets this transformation to a scaling about an arbitrary origin.
Parameters
Name | Type | Description |
---|---|---|
x | number | The x scaling factor. |
y | number | The y scaling factor. |
z | number | The z scaling factor. |
originX | number | The x-coordinate of the scaling origin. |
originY | number | The y-coordinate of the scaling origin. |
originZ | number | The z-coordinate of the scaling origin. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:357
toTranslation
▸ toTranslation(x
, y
, z
): this
Sets this transformation to a translation.
Parameters
Name | Type | Description |
---|---|---|
x | number | The x translation. |
y | number | The y translation. |
z | number | The z translation. |
Returns
this
This transformation, after it has been changed.
Defined in
src/sdk/math/Transform3D.ts:335
concat
▸ concat<T
>(out
, transforms
): T
Concatenates one or more transformations and returns the result. Concatenating transformations [A, B, ...]
results in a transformation that is equivalent to first applying A
, then applying B
, etc. Note that this order
is the opposite of the one resulting from multiplying the individual transformation matrices
M_A * M_B * ...
.
If the number of transformations to concatenate equals zero, the identity matrix is returned.
Type parameters
Name | Type |
---|---|
T | extends Transform3D |
Parameters
Name | Type | Description |
---|---|---|
out | T | The transformation to which to write the result. |
transforms | readonly ReadonlyTransform3D [] | The transformations to concatenate, in order. |
Returns
T
The result of concatenating all transformations in transforms
.
Defined in
src/sdk/math/Transform3D.ts:761