示例 平移

平移

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

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

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

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