 |
 |
 |
 |
Name |
|
translate() |
 |
|
|
Examples |
|
 |
translate(30, 20);
rect(0, 0, 55, 55);
|
 |
 |
translate(30, 20, -50);
rect(0, 0, 55, 55);
|
 |
 |
translate(30, 20);
rect(0, 0, 55, 55);
translate(14, 14);
rect(0, 0, 55, 55);
|
 |
|
Description |
|
Specifies the amount to move objects in space. The x parameter specifies left/right translation, the y paramater specifies up/down translation, and the z parameter specifies translation toward/away from the screen. Technically, translate() multiplies the current transformation matrix by a translation matrix. |
 |
|
|
Syntax |
|
translate(x, y);
translate(x, y, z);
|
 |
|
|
Parameters |
|
x |
|
int or float: left/right translation
|
y |
|
int or float: up/down translation
|
z |
|
int or float: forward/back translation
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
rotate() rotateX() rotateY() rotateZ() scale() push() pop() |
|