首页 > 代码库 > processing mousePressed

processing mousePressed

float  i=0;

boolean f=false;

float xx,yy,zz;

void setup() {

  size(200, 200, P3D);

  noFill();

  smooth();

  frameRate(25);

}


void draw() {

 

  background(0); 

  xx= width/2;

  yy=height/2;

  zz=-(width/2);

  translate(xx,yy,zz);

  rotateX(map(i++, 0, height, -PI, PI));

  rotateY(map(i++, 0, height, -PI, PI));

  stroke(150);

  box(75);

}


 

void mousePressed(){

    loop();

}



void mouseReleased(){

    noLoop();

}


本文出自 “processing” 博客,转载请与作者联系!

processing mousePressed