示例 平移

平移

translate() 函数将坐标系的原点移动到指定位置。

push()pop() 函数可以保存和恢复坐标系及其他各种绘图设置,比如填充颜色。

请注意,在这个例子中,我们在不同的坐标系中分别绘制了形状(矩形和圆)。

Creative Commons BY-NC-SA license badge

平移: Revised by Darren Kessner. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: 2023 code, pre-2023 code. You can suggest improvements by contributing to the current website!