rotate1.pde

来自「This is processing for java examples.」· PDE 代码 · 共 39 行

PDE
39
字号
/** * Rotate 1.  *  * Rotating simultaneously in the X and Y axis.  * Transformation functions such as rotate() are additive. * Successively calling rotate(1.0) and rotate(2.0) * is equivalent to calling rotate(3.0).  */ float a = 0.0;float rSize;  // rectangle sizevoid setup() {  size(640, 360, P3D);  rSize = width / 6;    noStroke();  fill(204, 204);}void draw() {  background(0);    a += 0.005;  if(a > TWO_PI) {     a = 0.0;   }    translate(width/2, height/2);    rotateX(a);  rotateY(a * 2.0);  rect(-rSize, -rSize, rSize*2, rSize*2);    rotateX(a * 1.001);  rotateY(a * 2.002);  rect(-rSize, -rSize, rSize*2, rSize*2);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?