Skip to main content

Class: Transform3D

Defined in: src/sdk/math/Transform3D.ts:9

A 3D affine transformation. By default, Transform3D objects are initially created as identity transformations.

Constructors​

Constructor​

new Transform3D(): Transform3D

Returns​

Transform3D

Methods​

addRotation()​

Call Signature​

addRotation(theta, axisX, axisY, axisZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:705

Adds a rotation about an arbitrary axis passing through the origin (0, 0, 0) to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
axisXnumberThe x component of the vector defining the direction of the rotation axis.
axisYnumberThe y component of the vector defining the direction of the rotation axis.
axisZnumberThe 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.

Call Signature​

addRotation(theta, axisX, axisY, axisZ, originX, originY, originZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:719

Adds a rotation about an arbitrary axis passing through an arbitrary point to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
axisXnumberThe x component of the vector defining the direction of the rotation axis.
axisYnumberThe y component of the vector defining the direction of the rotation axis.
axisZnumberThe z component of the vector defining the direction of the rotation axis.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe 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.


addRotationX()​

Call Signature​

addRotationX(theta, order?): this

Defined in: src/sdk/math/Transform3D.ts:573

Adds a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0) to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe 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.

Call Signature​

addRotationX(theta, originX, originY, originZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:584

Adds a rotation about an axis parallel to the x axis passing through an arbitrary point to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe 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.


addRotationY()​

Call Signature​

addRotationY(theta, order?): this

Defined in: src/sdk/math/Transform3D.ts:616

Adds a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0) to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe 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.

Call Signature​

addRotationY(theta, originX, originY, originZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:627

Adds a rotation about an axis parallel to the y axis passing through an arbitrary point to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe 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.


addRotationZ()​

Call Signature​

addRotationZ(theta, order?): this

Defined in: src/sdk/math/Transform3D.ts:659

Adds a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0) to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe 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.

Call Signature​

addRotationZ(theta, originX, originY, originZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:670

Adds a rotation about an axis parallel to the z axis passing through an arbitrary point to this transformation.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe 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.


addScale()​

Call Signature​

addScale(x, y, z, order?): this

Defined in: src/sdk/math/Transform3D.ts:528

Adds a scaling about the origin (0, 0, 0) to this transformation.

Parameters​
ParameterTypeDescription
xnumberThe x scaling factor.
ynumberThe y scaling factor.
znumberThe 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.

Call Signature​

addScale(x, y, z, originX, originY, originZ, order?): this

Defined in: src/sdk/math/Transform3D.ts:541

Adds a scaling about an arbitrary origin to this transformation.

Parameters​
ParameterTypeDescription
xnumberThe x scaling factor.
ynumberThe y scaling factor.
znumberThe z scaling factor.
originXnumberThe x-coordinate of the scaling origin.
originYnumberThe y-coordinate of the scaling origin.
originZnumberThe 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.


addTranslation()​

addTranslation(x, y, z, order): this

Defined in: src/sdk/math/Transform3D.ts:507

Adds a translation to this transformation.

Parameters​

ParameterTypeDefault valueDescription
xnumberundefinedThe x translation.
ynumberundefinedThe y translation.
znumberundefinedThe 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.


apply()​

apply(vec, out): Float64Array

Defined in: src/sdk/math/Transform3D.ts:294

Applies this transformation to a 3D vector.

Parameters​

ParameterTypeDescription
vecReadonlyFloat64ArrayA 3D vector.
outFloat64ArrayThe vector to which to write the result.

Returns​

Float64Array

The result of applying this transformation to vec.


copy()​

copy(): Transform3D

Defined in: src/sdk/math/Transform3D.ts:284

Copies this transformation.

Returns​

Transform3D

A copy of this transformation.


getParameters()​

getParameters(): Readonly<Float64Array>

Defined in: src/sdk/math/Transform3D.ts:21

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.


invert()​

invert(): this

Defined in: src/sdk/math/Transform3D.ts:225

Inverts this transformation.

Returns​

this

This transformation, after it has been inverted.

Throws​

Error if this transformation cannot be inverted.


offsetOrigin()​

offsetOrigin(x, y, z): this

Defined in: src/sdk/math/Transform3D.ts:312

Changes this transformation to the one that is the result of offsetting this transformation's origin.

Parameters​

ParameterTypeDescription
xnumberThe x-coordinate of the offset origin.
ynumberThe y-coordinate of the offset origin.
znumberThe z-coordinate of the offset origin.

Returns​

this

This transformation, after it has been changed.


set()​

Call Signature​

set(scaleX, skewXY, skewXZ, translateX, skewYX, scaleY, skewYZ, translateY, skewZX, skewZY, scaleZ, translateZ): this

Defined in: src/sdk/math/Transform3D.ts:41

Sets the parameters of this transformation.

Parameters​
ParameterTypeDescription
scaleXnumberThe x scaling factor.
skewXYnumberThe x skew factor along the y axis.
skewXZnumberThe x skew factor along the z axis.
translateXnumberThe x translation.
skewYXnumberThe y skew factor along the x axis.
scaleYnumberThe y scaling factor.
skewYZnumberThe y skew factor along the z axis.
translateYnumberThe y translation.
skewZXnumberThe z skew factor along the x axis.
skewZYnumberThe z skew factor along the y axis.
scaleZnumberThe z scaling factor.
translateZnumberThe z translation.
Returns​

this

This transformation, after it has been changed.

Call Signature​

set(transform): this

Defined in: src/sdk/math/Transform3D.ts:59

Sets the parameters of this transformation from another transformation.

Parameters​
ParameterTypeDescription
transformReadonlyTransform3DThe transformation from which to take parameters.
Returns​

this


setScale()​

setScale(x, y, z): this

Defined in: src/sdk/math/Transform3D.ts:133

Sets the x and y scaling factors of this transformation.

Parameters​

ParameterTypeDescription
xnumberThe new x scaling factor.
ynumberThe new y scaling factor.
znumberThe new z scaling factor.

Returns​

this

This transformation, after it has been changed.


setScaleX()​

setScaleX(value): this

Defined in: src/sdk/math/Transform3D.ts:101

Sets the x scaling factor of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new x scaling factor.

Returns​

this

This transformation, after it has been changed.


setScaleY()​

setScaleY(value): this

Defined in: src/sdk/math/Transform3D.ts:111

Sets the y scaling factor of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new y scaling factor.

Returns​

this

This transformation, after it has been changed.


setScaleZ()​

setScaleZ(value): this

Defined in: src/sdk/math/Transform3D.ts:121

Sets the z scaling factor of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new z scaling factor.

Returns​

this

This transformation, after it has been changed.


setSkewX()​

setSkewX(y, z): this

Defined in: src/sdk/math/Transform3D.ts:146

Sets the x skew factor of this transformation.

Parameters​

ParameterTypeDescription
ynumberThe new x skew factor along the y axis.
znumberThe new x skew factor along the z axis.

Returns​

this

This transformation, after it has been changed.


setSkewY()​

setSkewY(x, z): this

Defined in: src/sdk/math/Transform3D.ts:158

Sets the y skew factor of this transformation.

Parameters​

ParameterTypeDescription
xnumberThe new y skew factor along the x axis.
znumberThe new y skew factor along the z axis.

Returns​

this

This transformation, after it has been changed.


setSkewZ()​

setSkewZ(x, y): this

Defined in: src/sdk/math/Transform3D.ts:170

Sets the z skew factor of this transformation.

Parameters​

ParameterTypeDescription
xnumberThe new z skew factor along the x axis.
ynumberThe new z skew factor along the y axis.

Returns​

this

This transformation, after it has been changed.


setTranslate()​

setTranslate(x, y, z): this

Defined in: src/sdk/math/Transform3D.ts:213

Sets the x and y translations of this transformation.

Parameters​

ParameterTypeDescription
xnumberThe new x translation.
ynumberThe new y translation.
znumberThe new z translation.

Returns​

this

This transformation, after it has been changed.


setTranslateX()​

setTranslateX(value): this

Defined in: src/sdk/math/Transform3D.ts:181

Sets the x translation of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new x translation.

Returns​

this

This transformation, after it has been changed.


setTranslateY()​

setTranslateY(value): this

Defined in: src/sdk/math/Transform3D.ts:191

Sets the y translation of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new y translation.

Returns​

this

This transformation, after it has been changed.


setTranslateZ()​

setTranslateZ(value): this

Defined in: src/sdk/math/Transform3D.ts:201

Sets the z translation of this transformation.

Parameters​

ParameterTypeDescription
valuenumberThe new z translation.

Returns​

this

This transformation, after it has been changed.


toIdentity()​

toIdentity(): this

Defined in: src/sdk/math/Transform3D.ts:324

Sets this transformation to the identity transformation.

Returns​

this

This transformation, after it has been changed.


toRotation()​

Call Signature​

toRotation(theta, axisX, axisY, axisZ): this

Defined in: src/sdk/math/Transform3D.ts:456

Sets this transformation to a rotation about an arbitrary axis passing through the origin (0, 0, 0).

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
axisXnumberThe x component of the vector defining the direction of the rotation axis.
axisYnumberThe y component of the vector defining the direction of the rotation axis.
axisZnumberThe z component of the vector defining the direction of the rotation axis.
Returns​

this

This transformation, after it has been changed.

Call Signature​

toRotation(theta, axisX, axisY, axisZ, originX, originY, originZ): this

Defined in: src/sdk/math/Transform3D.ts:468

Sets this transformation to a rotation about an arbitrary axis passing through an arbitrary point.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
axisXnumberThe x component of the vector defining the direction of the rotation axis.
axisYnumberThe y component of the vector defining the direction of the rotation axis.
axisZnumberThe z component of the vector defining the direction of the rotation axis.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe z-coordinate of the rotation origin.
Returns​

this

This transformation, after it has been changed.


toRotationX()​

Call Signature​

toRotationX(theta): this

Defined in: src/sdk/math/Transform3D.ts:372

Sets this transformation to a rotation about an axis parallel to the x axis passing through the origin (0, 0, 0).

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
Returns​

this

This transformation, after it has been changed.

Call Signature​

toRotationX(theta, originX, originY, originZ): this

Defined in: src/sdk/math/Transform3D.ts:381

Sets this transformation to a rotation about an axis parallel to the x axis passing through an arbitrary point.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe z-coordinate of the rotation origin.
Returns​

this

This transformation, after it has been changed.


toRotationY()​

Call Signature​

toRotationY(theta): this

Defined in: src/sdk/math/Transform3D.ts:399

Sets this transformation to a rotation about an axis parallel to the y axis passing through the origin (0, 0, 0).

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
Returns​

this

This transformation, after it has been changed.

Call Signature​

toRotationY(theta, originX, originY, originZ): this

Defined in: src/sdk/math/Transform3D.ts:408

Sets this transformation to a rotation about an axis parallel to the y axis passing through an arbitrary point.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe z-coordinate of the rotation origin.
Returns​

this

This transformation, after it has been changed.


toRotationZ()​

Call Signature​

toRotationZ(theta): this

Defined in: src/sdk/math/Transform3D.ts:426

Sets this transformation to a rotation about an axis parallel to the z axis passing through the origin (0, 0, 0).

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
Returns​

this

This transformation, after it has been changed.

Call Signature​

toRotationZ(theta, originX, originY, originZ): this

Defined in: src/sdk/math/Transform3D.ts:435

Sets this transformation to a rotation about an axis parallel to the z axis passing through an arbitrary point.

Parameters​
ParameterTypeDescription
thetanumberThe rotation angle, in radians.
originXnumberThe x-coordinate of the rotation origin.
originYnumberThe y-coordinate of the rotation origin.
originZnumberThe z-coordinate of the rotation origin.
Returns​

this

This transformation, after it has been changed.


toScale()​

Call Signature​

toScale(x, y, z): this

Defined in: src/sdk/math/Transform3D.ts:346

Sets this transformation to a scaling about the origin (0, 0, 0).

Parameters​
ParameterTypeDescription
xnumberThe x scaling factor.
ynumberThe y scaling factor.
znumberThe z scaling factor.
Returns​

this

This transformation, after it has been changed.

Call Signature​

toScale(x, y, z, originX, originY, originZ): this

Defined in: src/sdk/math/Transform3D.ts:357

Sets this transformation to a scaling about an arbitrary origin.

Parameters​
ParameterTypeDescription
xnumberThe x scaling factor.
ynumberThe y scaling factor.
znumberThe z scaling factor.
originXnumberThe x-coordinate of the scaling origin.
originYnumberThe y-coordinate of the scaling origin.
originZnumberThe z-coordinate of the scaling origin.
Returns​

this

This transformation, after it has been changed.


toTranslation()​

toTranslation(x, y, z): this

Defined in: src/sdk/math/Transform3D.ts:335

Sets this transformation to a translation.

Parameters​

ParameterTypeDescription
xnumberThe x translation.
ynumberThe y translation.
znumberThe z translation.

Returns​

this

This transformation, after it has been changed.


concat()​

static concat<T>(out, transforms): T

Defined in: src/sdk/math/Transform3D.ts:761

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​

Type Parameter
T extends Transform3D

Parameters​

ParameterTypeDescription
outTThe transformation to which to write the result.
transformsreadonly ReadonlyTransform3D[]The transformations to concatenate, in order.

Returns​

T

The result of concatenating all transformations in transforms.