// 反転描画のテスト PGraphics pg; void setup() { size(256, 256); // 元画像作成 pg = createGraphics(64, 64); pg.beginDraw(); pg.background(128); pg.stroke(255); pg.line(48, 16, 48, 56); pg.line(16, 48, 56, 48); pg.endDraw(); } void draw() { // 左上に元画像を描画 image(pg, 0, 0); // 右上を描画。x方向を反転 scale(-1, 1); image(pg, -pg.width * 2, 0); // 右下を描画。x方向に加えてy方向も反転 scale(1, -1); image(pg, -pg.width * 2, -pg.height * 2); // 左下を描画。x方向を元に戻してy方向だけ反転してる状態に scale(-1, 1); image(pg, 0, -pg.height * 2); // y方向も元に戻す scale(1, -1); image(pg, pg.width * 2, pg.height * 2); }