Created
July 23, 2021 19:51
-
-
Save Morpholux/cfd626aa17ac1e3c69f0018243d1ba42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// renaud.jean-francois(arobas)uqam(point)ca | |
// Syntaxe Processing version 3.5.4 | |
// vendredi, 23 juillet 2021 | |
PGraphics pg; // declaration of PGraphics object | |
void setup() { | |
size(600, 600); | |
background(0); | |
pg = createGraphics(200, 200); // construction of PGraphics object at it’s own size | |
// PGraphics is build only once, in the setup() | |
// Note that every methods is called using name of instance before : like pg.fill() | |
pg.beginDraw(); | |
pg.noFill(); | |
pg.stroke(255); | |
pg.strokeWeight(3); | |
for (int i = 12; i <=272; i+= 20 ) { // 14 copies | |
pg.circle(100, 100, i); | |
} | |
pg.endDraw(); | |
} | |
void draw() { | |
background(0); | |
for (int j = 0; j<=400; j+=200) { | |
for (int i = 0; i<=400; i+=200) { | |
image(pg, i, j); | |
} | |
} | |
} |
Author
Morpholux
commented
Jul 23, 2021
The reference for the PGraphics object on the Processing Web site:
PGraphics
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment