|
|
发表于 2012-5-14 14:35:39
|
显示全部楼层
|
PGraphics pg1;PGraphics pg2;
void setup() {
size(100, 100,P3D);
pg = createGraphics(80, 80, P3D);
pg2 = createGraphics(80, 80, P3D);
}
boolean frame=true;
void draw() {
if(frame){
pg.beginDraw(); pg.background(102); pg.stroke(255);
pg.line(40, 40, mouseX, mouseY);
pg.endDraw(); image(pg2, 10, 10); }
else{
pg2.beginDraw(); pg2.background(102); pg2.stroke(255);
pg2.line(40, 40, mouseX, mouseY);
pg2.endDraw(); image(pg, 10, 10);
}
frame=!frame;
}
当然可以的 如果是显卡速度太慢 就多加buffer帧就行了 |
|