color[][] world;
void setup()
{
size(320, 240);
world = new color[width][height];
for (int i=0 ; i<width ; i++)
for (int j=0 ; j<height ; j++)
world[i][j] = color(0, 0, 0);
}
void draw()
{
drawScene();
}
void drawScene()
{
loadPixels();
for (int i=0 ; i<width ; i++)
for (int j=0 ; j<height; j++)
pixels[j*width + i] = world[i][j];
updatePixels();
}
沒有留言:
張貼留言