#N canvas 397 0 635 615 10;
#X obj 18 339 gemwin;
#X obj 64 425 gemhead;
#X msg 89 201 create;
#X msg 90 230 destroy;
#X obj 64 529 model ../data/venus.obj;
#X text 115 2 snap a portion of the graphics window into a texture
;
#X obj 399 385 pix_texture;
#X obj 399 450 rotateXYZ;
#X floatatom 500 419 0 0 0 0 - - -;
#X msg 339 370 snap;
#X msg 110 390 0;
#X obj 399 276 render_trigger;
#X obj 399 349 pix_snap 0 0 256 256;
#X obj 399 239 gemhead 60;
#X obj 399 473 square 3;
#X msg 34 94 \; render 1;
#X msg 32 50 \; render 0;
#X obj 18 201 r render;
#X obj 180 380 r render;
#X obj 295 342 t b b;
#X obj 295 217 r render;
#X msg 295 280 clear;
#X obj 295 249 sel 1;
#X obj 233 420 gemhead;
#X obj 233 530 model ../data/venus.obj;
#X obj 233 492 color 1 0 0;
#X obj 64 498 color 0 1 0;
#X obj 233 452 translateXYZ 1 0 1;
#X obj 64 458 translateXYZ -1 0 1;
#X text 369 175 notice that we use render_trigger;
#X text 369 192 to make sure that we snap before;
#X text 373 210 the square is drawn;
#X text 126 42 you may need to turn rendering off \, then on;
#X text 128 59 to get the snap to work right. This is because;
#X text 127 77 the first time rendering is turned on \, we might;
#X text 128 95 have garbage in the frame buffer;
#X text 127 126 rotate the square to see the texture;
#N canvas 26 40 290 300 Gem.init 0;
#X obj 71 191 outlet;
#X obj 71 81 loadbang;
#X msg 101 134 reset;
#X obj 71 109 t b b;
#X msg 71 164 dimen 256 256;
#X connect 1 0 3 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 3 1 2 0;
#X connect 4 0 0 0;
#X restore 57 313 pd Gem.init;
#N canvas 0 0 450 300 oneshot 0;
#X obj 93 82 inlet;
#X obj 187 148 bang;
#X msg 187 167 1;
#X obj 93 214 spigot;
#X msg 155 168 0;
#X obj 93 172 t a b;
#X obj 93 240 t a b;
#X obj 136 192 i 1;
#X obj 93 107 route clear;
#X obj 93 262 outlet;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 7 1;
#X connect 3 0 6 0;
#X connect 4 0 7 1;
#X connect 5 0 3 0;
#X connect 5 1 7 0;
#X connect 6 0 9 0;
#X connect 6 1 4 0;
#X connect 7 0 3 1;
#X connect 8 0 1 0;
#X connect 8 1 5 0;
#X restore 295 307 pd oneshot;
#X connect 1 0 28 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 6 0 7 0;
#X connect 7 0 14 0;
#X connect 8 0 7 2;
#X connect 9 0 12 0;
#X connect 10 0 1 0;
#X connect 10 0 23 0;
#X connect 11 0 12 0;
#X connect 11 1 38 0;
#X connect 12 0 6 0;
#X connect 13 0 11 0;
#X connect 17 0 0 0;
#X connect 18 0 1 0;
#X connect 18 0 23 0;
#X connect 19 0 10 0;
#X connect 19 1 9 0;
#X connect 20 0 22 0;
#X connect 21 0 38 0;
#X connect 22 0 21 0;
#X connect 23 0 27 0;
#X connect 25 0 24 0;
#X connect 26 0 4 0;
#X connect 27 0 25 0;
#X connect 28 0 26 0;
#X connect 37 0 0 0;
#X connect 38 0 19 0;
