#N canvas 291 194 635 615 8;
#X obj 16 338 gemwin;
#X obj 98 415 gemhead;
#X msg 87 200 create;
#X msg 88 229 destroy;
#X obj 98 519 model venus.obj;
#X text 115 2 snap a portion of the graphics window into a texture;
#X msg 60 310 dimen 256 256;
#X obj 397 384 pix_texture;
#X obj 397 493 rotateXYZ;
#X floatatom 458 458;
#X msg 337 369 snap;
#X msg 144 380 0;
#X obj 397 275 render_trigger;
#X obj 293 312 oneshot;
#X obj 397 348 pix_snap 0 0 256 256;
#X obj 397 238 gemhead 60;
#X obj 60 281 loadbang;
#X obj 397 525 square 3;
#X msg 34 94 \; render 1;
#X msg 32 50 \; render 0;
#X obj 16 200 r render;
#X obj 178 379 r render;
#X obj 293 341 t b b;
#X obj 293 216 r render;
#X msg 293 279 clear;
#X obj 293 248 sel 1;
#X obj 231 419 gemhead;
#X obj 231 529 model venus.obj;
#X obj 231 491 color 1 0 0;
#X obj 98 488 color 0 1 0;
#X obj 232 451 translateXYZ 1 0 1;
#X obj 97 449 translateXYZ -1 0 1;
#X text 367 174 notice that we use render_trigger;
#X text 367 191 to make sure that we snap before;
#X text 371 209 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;
#X connect 1 0 31 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 8 0;
#X connect 8 0 17 0;
#X connect 9 0 8 2;
#X connect 10 0 14 0;
#X connect 11 0 1 0;
#X connect 11 0 26 0;
#X connect 12 0 14 0;
#X connect 12 1 13 0;
#X connect 13 0 22 0;
#X connect 14 0 7 0;
#X connect 15 0 12 0;
#X connect 16 0 6 0;
#X connect 20 0 0 0;
#X connect 21 0 1 0;
#X connect 21 0 26 0;
#X connect 22 0 11 0;
#X connect 22 1 10 0;
#X connect 23 0 25 0;
#X connect 24 0 13 0;
#X connect 25 0 24 0;
#X connect 26 0 30 0;
#X connect 28 0 27 0;
#X connect 29 0 4 0;
#X connect 30 0 28 0;
#X connect 31 0 29 0;
