For example, the code in Listing 1 draws a square using the rect function, then specifies a change to the coordinatesystem using translate.
例如,清单1所示代码使用rect函数绘制了一个正方形,然后使用translate修改坐标系统。
2
Then, you create a new coordinatesystem that's centered within your display using translate and store this matrix.
然后,您可以使用 translate 创建一个位于显示器中央的新坐标系统。
3
Next, rotate and store this matrix; then, offset from the current coordinatesystem with translate (which is applied from the previously rotated and translated matrices), and draw a red ellipse.