首页 > 文档 > pushMatrix()保存矩阵
2017
07-13

pushMatrix()保存矩阵

pushMatrix()/popMatrix()

 
 

pushMatrix()保存矩阵 - 第1张  | Processing编程艺术

fill(255);

rect(0, 0, 50, 50); //白色方形

 

pushMatrix();

translate(30, 20);

fill(0);

rect(0, 0, 50, 50); // 黑色方形

popMatrix();

fill(100);

rect(15, 10, 50, 50); //灰色方形

描述:

矩阵堆栈弹出当前变换矩阵。了解push和pop需要了解一个矩阵堆栈的概念。pushmatrix()功能保存当前坐标系统堆栈和popmatrix()恢复之前的坐标系统。pushmatrix()和popmatrix()组合使用与其他变换功能,可以嵌入到控制转换的范围。



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。