translate()
Translates the 3D coordinate system
Example

Syntax
translate(x, y, [z])
Parameter
Description
x
right-left translation
y
up-down translation
z
forward-backward translation (only in WEBGL mode)
Full Example

Description
It shifts the origin on the coordinate system. Calling translate(50, 0, 0)
makes the point (50, 0, 0)
the new origin. To illustrate:
if one draws the point
(10, 0, 0)
before the translation, it appears 10 pixels to the right of the original center.if one draws the point
(10, 0, 0)
after the translation, it appears 10 pixels to the right of the new center, which is 60 pixels from the original center.
Like other transformations in the library (rotateX(), rotateY(), rotateZ()), this effect is cumulative. That is, calling translate(10, 0, 0)
then translate(20, 0, 0)
is the same as translate(30, 0, 0)
Last updated