hi nosehair,
In GLBuffer it seems you are sending both geos to the same buffer. GL_STENCIL_TEST. by changing them so they correspond to the GLend statements you can get the cirlce masking out the square circle from the second gemhead
This code seams very foreign to me, I seem to be missing a few of the abstractions, where is there documentation on GEMgl ?
I have been trying to figure out how to mask Geos with other Geos but I have hit a big roadblock.
Following the example in gem/openGL I have made 2 objects but it seems that Gem will only
recognize 1 or the other. I have attached an example. If anyone with openGL understanding could
give me a hand I would really appreciate that.
Thanks,
Alain
--------------------------------------------------
#N canvas 415 342 624 471 10;
#N canvas 0 22 450 300 gemwin 0;
#X obj 132 136 gemwin;
#X obj 67 89 outlet;
#X obj 67 10 inlet;
#X obj 67 41 route create;
#X msg 67 70 set destroy;
#X msg 142 68 set create;
#X msg 198 112 destroy;
#X msg 132 112 create \, 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 7 0;
#X connect 3 1 5 0;
#X connect 3 1 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X restore 23 42 pd gemwin;
#X msg 23 23 create;
#N canvas 0 22 449 605 GLbuffer 0;
#X obj 44 192 GEMglEnable;
#X floatatom 130 194 5 0 0 0 - - -;
#X obj 116 135 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 116 167 GLdefine GL_STENCIL_TEST;
#X obj 159 146 loadbang;
#X obj 109 244 GLdefine GL_STENCIL_BUFFER_BIT;
#X obj 171 223 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X floatatom 124 269 5 0 0 0 - - -;
#X obj 109 221 loadbang;
#X obj 44 111 GEMglClearStencil 0;
#X obj 44 269 GEMglClear;
#X obj 44 368 GEMglStencilFunc;
#X msg 151 342 1;
#X obj 82 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 79 321 GLdefine GL_ALWAYS;
#X obj 128 300 loadbang;
#X floatatom 105 342 5 0 0 0 - - -;
#X obj 44 441 GEMglStencilOp;
#X floatatom 154 444 5 0 0 0 - - -;
#X obj 75 348 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 75 414 GLdefine GL_REPLACE;
#X obj 100 392 loadbang;
#X text 38 16 allow \, clear and configure stencil buffer;
#X obj 44 63 inlet;
#X obj 44 495 outlet;
#X obj 348 63 inlet;
#X obj 348 120 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 208 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 279 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 333 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 96 64 gemhead;
#X text 298 62 reset;
#X connect 0 0 10 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 3 0 0 1;
#X connect 4 0 3 0;
#X connect 5 0 7 0;
#X connect 5 0 10 1;
#X connect 6 0 5 0;
#X connect 8 0 5 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 11 0 17 0;
#X connect 12 0 11 3;
#X connect 12 0 11 2;
#X connect 13 0 14 0;
#X connect 13 0 12 0;
#X connect 14 0 11 1;
#X connect 14 0 16 0;
#X connect 15 0 12 0;
#X connect 15 0 14 0;
#X connect 17 0 24 0;
#X connect 19 0 20 0;
#X connect 20 0 18 0;
#X connect 20 0 17 1;
#X connect 20 0 17 2;
#X connect 20 0 17 3;
#X connect 21 0 19 0;
#X connect 23 0 9 0;
#X connect 25 0 26 0;
#X connect 26 0 2 0;
#X connect 26 0 27 0;
#X connect 27 0 6 0;
#X connect 27 0 28 0;
#X connect 28 0 13 0;
#X connect 28 0 29 0;
#X connect 29 0 19 0;
#X restore 342 162 pd GLbuffer;
#X obj 342 195 circle 0.5;
#N canvas 0 22 495 566 GLaround 0;
#X obj 259 125 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 190 124 loadbang;
#X obj 68 192 GEMglClear;
#X floatatom 186 193 5 0 0 0 - - -;
#X obj 162 170 GLdefine GL_DEPTH_BUFFER_BIT;
#X obj 146 125 t b b;
#X obj 146 148 GLdefine GL_COLOR_BUFFER_BIT;
#X obj 146 191 |;
#X text 130 88 clear color and depth buffer;
#X obj 68 40 inlet;
#X obj 68 330 GEMglStencilFunc;
#X msg 175 306 1;
#X obj 103 263 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 160 266 loadbang;
#X floatatom 113 307 5 0 0 0 - - -;
#X obj 103 284 GLdefine GL_NOTEQUAL;
#X obj 68 408 GEMglStencilOp;
#X floatatom 179 407 5 0 0 0 - - -;
#X obj 99 353 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 139 356 loadbang;
#X obj 99 374 GLdefine GL_KEEP;
#X text 124 229 draw where the stencil buffer is not 1;
#X obj 68 496 outlet;
#X obj 404 42 inlet;
#X obj 404 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 404 248 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 404 338 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 121 40 gemhead;
#X text 356 41 reset;
#X connect 0 0 5 0;
#X connect 1 0 5 0;
#X connect 2 0 10 0;
#X connect 4 0 7 1;
#X connect 5 0 6 0;
#X connect 5 1 4 0;
#X connect 6 0 7 0;
#X connect 7 0 3 0;
#X connect 7 0 2 1;
#X connect 9 0 2 0;
#X connect 10 0 16 0;
#X connect 11 0 10 3;
#X connect 11 0 10 2;
#X connect 12 0 15 0;
#X connect 13 0 11 0;
#X connect 13 0 15 0;
#X connect 15 0 10 1;
#X connect 15 0 14 0;
#X connect 16 0 22 0;
#X connect 18 0 20 0;
#X connect 19 0 18 0;
#X connect 20 0 17 0;
#X connect 20 0 16 1;
#X connect 20 0 16 2;
#X connect 20 0 16 3;
#X connect 23 0 24 0;
#X connect 24 0 0 0;
#X connect 24 0 25 0;
#X connect 25 0 12 0;
#X connect 25 0 26 0;
#X connect 26 0 18 0;
#X restore 342 235 pd GLaround;
#N canvas 409 89 458 308 GLend 0;
#X floatatom 115 175 5 0 0 0 - - -;
#X obj 97 109 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 97 150 GLdefine GL_STENCIL_TEST;
#X obj 115 125 loadbang;
#X obj 18 175 GEMglDisable;
#X obj 18 16 inlet;
#X obj 97 16 inlet;
#X obj 18 237 outlet;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 2 0 4 1;
#X connect 3 0 2 0;
#X connect 4 0 7 0;
#X connect 5 0 4 0;
#X connect 6 0 1 0;
#X restore 342 306 pd GLend;
#X obj 342 272 square 1;
#X obj 342 100 translateXYZ;
#X floatatom 434 54 5 0 0 0 - - -;
#X obj 417 76 * 0.1;
#X obj 342 65 gemhead 2;
#X obj 342 130 colorRGB 1 0 0;
#N canvas 0 22 449 605 GLbuffer 0;
#X obj 44 192 GEMglEnable;
#X floatatom 130 194 5 0 0 0 - - -;
#X obj 116 135 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 116 167 GLdefine GL_STENCIL_TEST;
#X obj 159 146 loadbang;
#X obj 109 244 GLdefine GL_STENCIL_BUFFER_BIT;
#X obj 171 223 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X floatatom 124 269 5 0 0 0 - - -;
#X obj 109 221 loadbang;
#X obj 44 111 GEMglClearStencil 0;
#X obj 44 269 GEMglClear;
#X obj 44 368 GEMglStencilFunc;
#X msg 151 342 1;
#X obj 82 294 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 79 321 GLdefine GL_ALWAYS;
#X obj 128 300 loadbang;
#X floatatom 105 342 5 0 0 0 - - -;
#X obj 44 441 GEMglStencilOp;
#X floatatom 154 444 5 0 0 0 - - -;
#X obj 75 348 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 75 414 GLdefine GL_REPLACE;
#X obj 100 392 loadbang;
#X text 38 16 allow \, clear and configure stencil buffer;
#X obj 44 63 inlet;
#X obj 44 495 outlet;
#X obj 348 63 inlet;
#X obj 348 120 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 208 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 279 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 348 333 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 96 64 gemhead;
#X text 298 62 reset;
#X connect 0 0 10 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 3 0 0 1;
#X connect 4 0 3 0;
#X connect 5 0 7 0;
#X connect 5 0 10 1;
#X connect 6 0 5 0;
#X connect 8 0 5 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 11 0 17 0;
#X connect 12 0 11 3;
#X connect 12 0 11 2;
#X connect 13 0 14 0;
#X connect 13 0 12 0;
#X connect 14 0 11 1;
#X connect 14 0 16 0;
#X connect 15 0 12 0;
#X connect 15 0 14 0;
#X connect 17 0 24 0;
#X connect 19 0 20 0;
#X connect 20 0 18 0;
#X connect 20 0 17 1;
#X connect 20 0 17 2;
#X connect 20 0 17 3;
#X connect 21 0 19 0;
#X connect 23 0 9 0;
#X connect 25 0 26 0;
#X connect 26 0 2 0;
#X connect 26 0 27 0;
#X connect 27 0 6 0;
#X connect 27 0 28 0;
#X connect 28 0 13 0;
#X connect 28 0 29 0;
#X connect 29 0 19 0;
#X restore 140 168 pd GLbuffer;
#X obj 140 201 circle 0.5;
#N canvas 0 22 495 566 GLaround 0;
#X obj 259 125 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 190 124 loadbang;
#X obj 68 192 GEMglClear;
#X floatatom 186 193 5 0 0 0 - - -;
#X obj 162 170 GLdefine GL_DEPTH_BUFFER_BIT;
#X obj 146 125 t b b;
#X obj 146 148 GLdefine GL_COLOR_BUFFER_BIT;
#X obj 146 191 |;
#X text 130 88 clear color and depth buffer;
#X obj 68 40 inlet;
#X obj 68 330 GEMglStencilFunc;
#X msg 175 306 1;
#X obj 103 263 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 160 266 loadbang;
#X floatatom 113 307 5 0 0 0 - - -;
#X obj 103 284 GLdefine GL_NOTEQUAL;
#X obj 68 408 GEMglStencilOp;
#X floatatom 179 407 5 0 0 0 - - -;
#X obj 99 353 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 139 356 loadbang;
#X obj 99 374 GLdefine GL_KEEP;
#X text 124 229 draw where the stencil buffer is not 1;
#X obj 68 496 outlet;
#X obj 404 42 inlet;
#X obj 404 110 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 404 248 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 404 338 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 121 40 gemhead;
#X text 356 41 reset;
#X connect 0 0 5 0;
#X connect 1 0 5 0;
#X connect 2 0 10 0;
#X connect 4 0 7 1;
#X connect 5 0 6 0;
#X connect 5 1 4 0;
#X connect 6 0 7 0;
#X connect 7 0 3 0;
#X connect 7 0 2 1;
#X connect 9 0 2 0;
#X connect 10 0 16 0;
#X connect 11 0 10 3;
#X connect 11 0 10 2;
#X connect 12 0 15 0;
#X connect 13 0 11 0;
#X connect 13 0 15 0;
#X connect 15 0 10 1;
#X connect 15 0 14 0;
#X connect 16 0 22 0;
#X connect 18 0 20 0;
#X connect 19 0 18 0;
#X connect 20 0 17 0;
#X connect 20 0 16 1;
#X connect 20 0 16 2;
#X connect 20 0 16 3;
#X connect 23 0 24 0;
#X connect 24 0 0 0;
#X connect 24 0 25 0;
#X connect 25 0 12 0;
#X connect 25 0 26 0;
#X connect 26 0 18 0;
#X restore 140 241 pd GLaround;
#N canvas 409 89 458 308 GLend 0;
#X floatatom 115 175 5 0 0 0 - - -;
#X obj 97 109 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 97 150 GLdefine GL_STENCIL_TEST;
#X obj 115 125 loadbang;
#X obj 18 175 GEMglDisable;
#X obj 18 16 inlet;
#X obj 97 16 inlet;
#X obj 18 237 outlet;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 2 0 4 1;
#X connect 3 0 2 0;
#X connect 4 0 7 0;
#X connect 5 0 4 0;
#X connect 6 0 1 0;
#X restore 140 312 pd GLend;
#X obj 140 278 square 1;
#X obj 140 106 translateXYZ;
#X floatatom 232 60 5 0 0 0 - - -;
#X obj 215 82 * 0.1;
#X obj 140 71 gemhead 1;
#X obj 140 136 colorRGB 1 1 1;
#X connect 0 0 1 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 6 0 5 0;
#X connect 7 0 11 0;
#X connect 8 0 9 0;
#X connect 9 0 7 1;
#X connect 10 0 7 0;
#X connect 11 0 2 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 16 0;
#X connect 16 0 15 0;
#X connect 17 0 21 0;
#X connect 18 0 19 0;
#X connect 19 0 17 1;
#X connect 20 0 17 0;
#X connect 21 0 12 0;
_______________________________________________
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list