Skip to main content

translate()

Translates objects along the X axis.

Returns: SceneObject

tip

See the guide for detailed usage examples.

Signatures

translate(x: number, ...targets: SceneObject[]): SceneObject

Translates objects along the X axis.

ParameterTypeDescription
xnumberThe X distance
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(x: number, copy: boolean, ...targets: SceneObject[]): SceneObject

Translates objects along the X axis, optionally making a copy.

ParameterTypeDescription
xnumberThe X distance
copybooleanWhether to copy instead of move
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(x: number, y: number, ...targets: SceneObject[]): SceneObject

Translates objects along the X and Y axes.

ParameterTypeDescription
xnumberThe X distance
ynumberThe Y distance
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(x: number, y: number, copy: boolean, ...targets: SceneObject[]): SceneObject

Translates objects along the X and Y axes, optionally making a copy.

ParameterTypeDescription
xnumberThe X distance
ynumberThe Y distance
copybooleanWhether to copy instead of move
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(x: number, y: number, z: number, ...targets: SceneObject[]): SceneObject

Translates objects along all three axes.

ParameterTypeDescription
xnumberThe X distance
ynumberThe Y distance
znumberThe Z distance
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(x: number, y: number, z: number, copy: boolean, ...targets: SceneObject[]): SceneObject

Translates objects along all three axes, optionally making a copy.

ParameterTypeDescription
xnumberThe X distance
ynumberThe Y distance
znumberThe Z distance
copybooleanWhether to copy instead of move
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(distance: PointLike, ...targets: SceneObject[]): SceneObject

Translates objects by a point-like offset.

ParameterTypeDescription
distancePointLikeThe offset as a point
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)

translate(distance: PointLike, copy: boolean, ...targets: SceneObject[]): SceneObject

Translates objects by a point-like offset, optionally making a copy.

ParameterTypeDescription
distancePointLikeThe offset as a point
copybooleanWhether to copy instead of move
...targetsSceneObject[]The objects to translate (defaults to last object) (optional)