Forums > Jitter

Benefits of using Poly~ with OpenGL?

June 15, 2007 | 3:14 pm

Hi,
I am just wondering if anybody knows if there is any benefit in using a Poly~ object in combination with OpenGL objects. Below is example code of a test I have have put together.

If there are any benefits would anybody mind explaining to me what these may be so that I may make a more educated decision whether to continue with this or not.

Many Thanks

Andy

max v2;
#N vpatcher 11 55 1287 1035;
#P window setfont "Sans Serif" 9.;
#P newex 525 305 27 196617 1;
#P message 14 280 70 196617 name window;
#P newex 29 30 48 196617 loadbang;
#P newex 29 56 79 196617 t b b b b b b;
#P newex 317 95 66 196617 t b b b b b;
#P newex 233 95 66 196617 t b b b b b;
#P newex 149 95 66 196617 t b b b b b;
#P newex 29 95 66 196617 t b b b b b;
#P message 233 196 80 196617 target 5 , -0.11;
#P message 233 180 80 196617 target 4 , -0.11;
#P message 233 164 75 196617 target 3 , 0.51;
#P message 233 148 75 196617 target 2 , 0.51;
#P message 233 132 75 196617 target 1 , 0.51;
#P message 149 196 80 196617 target 5 , -0.23;
#P message 149 180 80 196617 target 4 , -0.85;
#P message 149 164 75 196617 target 3 , 0.39;
#P message 149 148 80 196617 target 2 , -0.23;
#P message 149 132 80 196617 target 1 , -0.85;
#P message 317 196 69 196617 target 5 , 0.3;
#P message 317 180 69 196617 target 4 , 0.3;
#P message 317 164 69 196617 target 3 , 0.3;
#P message 317 148 69 196617 target 2 , 0.3;
#P message 317 132 69 196617 target 1 , 0.3;
#P message 29 196 117 196617 target 5 , texture Test5;
#P message 29 180 117 196617 target 4 , texture Test4;
#P message 29 164 117 196617 target 3 , texture Test3;
#P message 29 148 117 196617 target 2 , texture Test2;
#P message 29 132 117 196617 target 1 , texture Test1;
#P button 1076 66 15 0;
#P message 1092 66 30 196617 read;
#P newex 1076 95 105 196617 jit.qt.movie 150 150;
#P newex 1076 122 169 196617 jit.gl.texture window @name Test5;
#P button 905 66 15 0;
#P message 921 66 30 196617 read;
#P newex 905 95 105 196617 jit.qt.movie 150 150;
#P newex 905 122 169 196617 jit.gl.texture window @name Test4;
#P button 734 66 15 0;
#P message 750 66 30 196617 read;
#P newex 734 95 105 196617 jit.qt.movie 150 150;
#P newex 734 122 169 196617 jit.gl.texture window @name Test3;
#P button 563 66 15 0;
#P message 579 66 30 196617 read;
#P newex 563 95 105 196617 jit.qt.movie 150 150;
#P newex 563 122 169 196617 jit.gl.texture window @name Test2;
#P button 392 66 15 0;
#P message 408 66 30 196617 read;
#P newex 392 95 105 196617 jit.qt.movie 150 150;
#P newex 107 231 265 196617 poly~ GL_Poly 5;
#P newex 392 122 169 196617 jit.gl.texture window @name Test1;
#P user jit.fpsgui 569 438 60 196617 0;
#P newex 525 381 43 196617 jit.qball;
#P number 570 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 525 332 15 0;
#P newex 525 358 55 196617 metro 20;
#P newex 525 412 55 196617 t b erase b;
#P newex 525 482 102 196617 jit.gl.render window;
#P user jit.pwindow 13 303 499 353 0 1 0 0 1 0;
#X name window;
#P fasten 53 4 55 0 86 84 19 84;
#P connect 55 0 0 0;
#P connect 54 0 53 0;
#P fasten 53 0 49 0 34 83 34 83;
#P fasten 49 4 29 0 90 125 34 125;
#P fasten 49 3 30 0 76 125 34 125;
#P fasten 49 2 31 0 62 125 34 125;
#P fasten 49 1 32 0 48 125 34 125;
#P fasten 49 0 33 0 34 125 34 125;
#P fasten 33 0 9 0 34 221 112 221;
#P fasten 32 0 9 0 34 221 112 221;
#P fasten 31 0 9 0 34 221 112 221;
#P fasten 30 0 9 0 34 221 112 221;
#P fasten 29 0 9 0 34 220 112 220;
#P fasten 53 1 50 0 47 84 154 84;
#P fasten 50 4 39 0 210 125 154 125;
#P fasten 50 3 40 0 196 125 154 125;
#P fasten 50 2 41 0 182 125 154 125;
#P fasten 50 1 42 0 168 125 154 125;
#P fasten 50 0 43 0 154 125 154 125;
#P connect 39 0 9 1;
#P connect 40 0 9 1;
#P connect 41 0 9 1;
#P connect 42 0 9 1;
#P connect 43 0 9 1;
#P fasten 44 0 9 2 238 221 196 221;
#P fasten 45 0 9 2 238 221 196 221;
#P fasten 46 0 9 2 238 221 196 221;
#P fasten 47 0 9 2 238 221 196 221;
#P fasten 48 0 9 2 238 221 196 221;
#P fasten 53 2 51 0 60 84 238 84;
#P fasten 51 4 44 0 294 125 238 125;
#P fasten 51 3 45 0 280 125 238 125;
#P fasten 51 2 46 0 266 125 238 125;
#P fasten 51 1 47 0 252 125 238 125;
#P fasten 51 0 48 0 238 125 238 125;
#P fasten 38 0 9 4 322 217 280 217;
#P fasten 36 0 9 4 322 217 280 217;
#P fasten 34 0 9 4 322 217 280 217;
#P fasten 37 0 9 4 322 217 280 217;
#P fasten 35 0 9 4 322 217 280 217;
#P fasten 53 3 52 0 73 84 322 84;
#P fasten 52 4 34 0 378 125 322 125;
#P fasten 52 3 35 0 364 125 322 125;
#P fasten 52 2 36 0 350 125 322 125;
#P fasten 52 1 37 0 336 125 322 125;
#P fasten 52 0 38 0 322 125 322 125;
#P fasten 38 0 9 5 322 217 322 217;
#P fasten 37 0 9 5 322 217 322 217;
#P fasten 36 0 9 5 322 217 322 217;
#P fasten 35 0 9 5 322 217 322 217;
#P fasten 34 0 9 5 322 217 322 217;
#P connect 12 0 10 0;
#P fasten 11 0 10 0 413 88 397 88;
#P connect 10 0 8 0;
#P fasten 53 5 56 0 99 84 19 84 19 272 530 272;
#P connect 56 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 2 0;
#P connect 2 0 1 0;
#P fasten 2 1 1 0 552 440 530 440;
#P fasten 15 0 14 0 584 88 568 88;
#P connect 16 0 14 0;
#P connect 14 0 13 0;
#P connect 2 2 7 0;
#P connect 5 0 3 1;
#P connect 20 0 18 0;
#P fasten 19 0 18 0 755 88 739 88;
#P connect 18 0 17 0;
#P fasten 23 0 22 0 926 88 910 88;
#P connect 24 0 22 0;
#P connect 22 0 21 0;
#P connect 28 0 26 0;
#P fasten 27 0 26 0 1097 88 1081 88;
#P connect 26 0 25 0;
#P pop;



VG
June 15, 2007 | 3:35 pm


June 15, 2007 | 3:45 pm

Sorry. Here it is.

max v2;
#N vpatcher 1490 700 2087 926;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N in 7;
#P newobj 290 50 25 196617 in 7;
#N in 6;
#P newobj 253 50 25 196617 in 6;
#N in 5;
#P newobj 213 50 25 196617 in 5;
#N in 4;
#P newobj 172 50 25 196617 in 4;
#N in 3;
#P newobj 134 50 25 196617 in 3;
#N in 2;
#P newobj 94 50 25 196617 in 2;
#N in 1;
#P newobj 50 50 25 196617 in 1;
#P flonum 290 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 253 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 213 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 188 103 85 196617 pak scale 1. 1. 1.;
#P flonum 172 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 134 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 94 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 66 103 95 196617 pak position 0. 0. 0.;
#P newex 50 135 177 196617 jit.gl.gridshape window @shape plane;
#P connect 9 0 0 0;
#P fasten 5 0 0 0 193 128 55 128;
#P fasten 1 0 0 0 71 128 55 128;
#P connect 10 0 2 0;
#P connect 2 0 1 1;
#P fasten 3 0 1 2 139 98 127 98;
#P connect 11 0 3 0;
#P fasten 4 0 1 3 177 98 155 98;
#P connect 12 0 4 0;
#P connect 13 0 6 0;
#P connect 6 0 5 1;
#P fasten 7 0 5 2 258 97 243 97;
#P connect 14 0 7 0;
#P fasten 8 0 5 3 295 97 268 97;
#P connect 15 0 8 0;
#P pop;


June 15, 2007 | 4:04 pm

Based on what it looks like you are trying to accomplish, you would be
better served using either jit.gl.multiple, the jit.iter technique (used
in many of the Jitter Recipes), or using an Array of gridshapes in
JavaScript or Lua. For this type of thing, poly~ can be a little bit
cumbersome.

AB


June 15, 2007 | 5:10 pm

I need to be able to treat each of the objects seperately- i.e different textures (or movie players if I use videoplanes – which I probably will) and the ability to move and resize each plane independantly of the others.

I already have a working system, but I am exploring ways of reducing CPU/GPU requirements – which is what led me to poly~. I understand the implications with audio but am a little less knowledgeable when it comes to visuals – i.e I don’t know if using poly’s saves anything at all.

I have used javascript to create gridshape objects before but exerienced disappearing objects when alt-Left click was used. I am unaware of the jit.iter technique or Lua so will look int these.

Cheers

Andy


Viewing 5 posts - 1 through 5 (of 5 total)