Forums > Jitter

"shatter" type effect using jit.gl.multiple + texture scaling question

December 26, 2006 | 5:03 pm

hi all
I looked through the list and couldn’t really find anything on the subject. So at the risk of sounding dumb: I’m trying to use jit.gl.multiple to create a "shatter" type effect that may be controlled in real time- e.g split a single video image onto an arbitary number of 3dobj pieces, which may be pieced together or taken apart via the control matrices of jit.gl.multiple. Has anyone done something similar? any ideas would be welcome, as this needs to be as efficient as possible.

My current problem is that for some reason I can’t get the texture to render properly for jit.gl.multiple. It seems like I don’t get something with the texture mapping- tex_map and tex_scale_s/t, which I use for mapping the texture in "eyespace" setting and scaling it so that it fills the whole gridshape, don’t work with jit.gl.multiple. I use tex_gen instead on the jit.gl.texture object, but can’t find how to scale the texture there as I would with tex_scale_s or t. Hope any of this makes sense. Here’s the patch:

max v2;
#N vpatcher 448 106 1257 733;
#P origin -2 0;
#P window setfont "Sans Serif" 9.;
#P newex 747 244 33 196617 r init;
#B color 5;
#P newex 681 28 33 196617 r init;
#B color 5;
#P newex 168 386 33 196617 s init;
#B color 5;
#P message 717 340 14 196617 3;
#P message 712 387 23 196617 0.1;
#P message 739 387 23 196617 0.5;
#P message 642 50 17 196617 1.;
#P message 624 50 14 196617 2;
#P window setfont "Arial Black" 9.;
#P window linecount 6;
#P comment 69 267 67 791478281 this is connected just to compare the texture scaling;
#P window setfont "Sans Serif" 9.;
#P flonum 675 331 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 637 331 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 597 331 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 597 353 95 196617 pak position 0. 0. 0.;
#P flonum 557 406 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 629 449 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 665 448 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 672 406 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 592 448 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 634 406 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 551 447 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 594 406 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 534 425 130 196617 pak tex_plane_t 0. 1. 0. 0.;
#P newex 520 468 131 196617 pak tex_plane_s 1. 0. 0. 0.;
#P toggle 339 363 15 0;
#P message 286 386 92 196617 lighting_enable $1;
#P flonum 609 149 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 536 363 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 535 383 64 196617 tex_map $1;
#P window setfont "Arial Black" 9.;
#P window linecount 2;
#P comment 527 491 190 791478281 how do i scale the texture in the same way for jit.gl.multiple?;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 435 383 71 196617 prepend shape;
#P user ubumenu 435 357 72 196617 0 1 1 0;
#X add sphere;
#X add torus;
#X add cylinder;
#X add opencylinder;
#X add cube;
#X add opencube;
#X add plane;
#X add circle;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P user jit.pwindow 239 323 82 62 0 0 0 0 1 0;
#P newex 96 180 40 196617 t b b b;
#P flonum 217 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 217 288 42 196617 rate $1;
#P message 277 268 102 196617 read countdown.mov;
#P newex 142 325 105 196617 jit.qt.movie 320 240;
#P toggle 99 486 15 0;
#P message 99 505 78 196617 auto_rotate $1;
#P newex 531 147 52 196617 s dimmer;
#B color 5;
#P newex 466 147 56 196617 s loadbang;
#B color 5;
#P newex 466 113 27 196617 t b l;
#P number 519 39 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 535 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 496 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 466 87 74 196617 pak dim 15 15;
#P newex 361 334 54 196617 s multiple;
#B color 5;
#P toggle 361 293 15 0;
#P message 361 315 76 196617 targetmode $1;
#P newex 246 134 56 196617 r loadbang;
#B color 5;
#P newex 107 386 56 196617 s loadbang;
#B color 5;
#P newex 685 222 54 196617 s multiple;
#B color 5;
#P flonum 641 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 603 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 563 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 563 199 85 196617 pak scale 1. 1. 1.;
#P flonum 763 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 725 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 685 177 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 685 199 95 196617 pak position 0. 0. 0.;
#P newex 160 155 54 196617 r multiple;
#B color 5;
#N vpatcher 542 153 1241 746;
#P origin 37 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 421 159 14 196617 1;
#P newex 421 135 33 196617 r init;
#B color 5;
#N vpreset 1;
#X append 1 1 13 352 520 ubumenu int 4 ; 21 302 503 ubumenu int 1 ; 31 254 494 ubumenu int 0 ; 19 352 408 ubumenu int 2 ; 23 303 393 ubumenu int 0 ; 15 352 300 ubumenu int;
#X append 1 1 3 ; 29 181 289 ubumenu int 1 ; 25 304 285 ubumenu int 1 ; 26 181 197 ubumenu int 1 ; 17 352 192 ubumenu int 0 ;;
#P preset 421 182 47 27;
#P newex 88 164 42 196617 r totex;
#P user ubumenu 494 254 100 196617 0 1 1 0;
#X add none;
#X add dxt1;
#X add dxt3;
#X add dxt5;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 493 277 90 196617 prepend compress;
#P user ubumenu 289 181 100 196617 0 1 1 0;
#X add none;
#X add objectspace;
#X add viewspace;
#X add environment;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 296 202 75 196617 prepend texgen;
#P newex 197 203 88 196617 prepend precision;
#P user ubumenu 197 181 72 196617 0 1 1 0;
#X add half;
#X add full;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 285 304 100 196617 0 1 1 0;
#X add static;
#X add dynamic;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 292 329 70 196617 prepend mode;
#P user ubumenu 393 303 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X add bilinear;
#X add trilinear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 400 328 81 196617 prepend mipmap;
#P user ubumenu 503 302 100 196617 0 1 1 0;
#X add nicest;
#X add fastest;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 510 327 94 196617 prepend correction;
#P user ubumenu 408 352 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 415 377 71 196617 prepend filter;
#P user ubumenu 192 352 100 196617 0 1 1 0;
#X add auto;
#X add alpha;
#X add luminance;
#X add intensity;
#X add depth;
#X add lumalpha;
#X add rgb;
#X add argb;
#X add uyvy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 199 377 93 196617 prepend colormode;
#P user ubumenu 300 352 100 196617 0 1 1 0;
#X add clamp;
#X add repeat;
#X add clampedge;
#X add clampborder;
#X add mirroredrepeat;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 307 377 70 196617 prepend wrap;
#P user ubumenu 520 352 100 196617 0 1 1 0;
#X add replace;
#X add decal;
#X add modulate;
#X add blend;
#X add combine;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 527 377 71 196617 prepend apply;
#P newex 175 405 42 196617 s totex;
#P message 423 66 30 196617 none;
#P user gswitch 27 125 41 32 0 0;
#P button 112 39 15 0;
#P window linecount 0;
#P newex 112 63 109 196617 jit.noise 4 char 50 50;
#P window linecount 1;
#P message 463 43 53 196617 projected;
#P message 402 44 51 196617 eyespace;
#P message 331 44 63 196617 objectspace;
#P window linecount 0;
#P newex 330 64 78 196617 prepend texgen;
#P message 228 43 66 196617 environment;
#P newex -3 198 133 196617 jit.gl.texture foo @name t3;
#P inlet 13 30 15 0;
#P connect 3 0 1 0;
#P connect 9 0 1 0;
#P connect 32 0 1 0;
#P connect 0 0 9 1;
#P connect 7 0 9 2;
#P connect 8 0 7 0;
#P connect 28 0 11 0;
#P connect 27 0 11 0;
#P fasten 12 0 11 0 532 397 180 397;
#P fasten 16 0 11 0 204 397 180 397;
#P fasten 14 0 11 0 312 397 180 397;
#P fasten 18 0 11 0 420 397 180 397;
#P fasten 22 0 11 0 405 397 180 397;
#P fasten 24 0 11 0 297 397 180 397;
#P fasten 20 0 11 0 515 397 180 397;
#P fasten 30 0 11 0 498 348 180 348;
#P connect 33 0 17 0;
#P connect 33 0 26 0;
#P fasten 26 1 27 0 233 198 202 198;
#P fasten 17 1 16 0 242 372 204 372;
#P connect 33 0 25 0;
#P connect 33 0 29 0;
#P fasten 25 1 24 0 335 324 297 324;
#P fasten 29 1 28 0 339 199 301 199;
#P connect 33 0 15 0;
#P fasten 15 1 14 0 350 372 312 372;
#P connect 4 0 3 0;
#P connect 6 0 3 0;
#P connect 5 0 3 0;
#P connect 2 0 3 0;
#P connect 10 0 3 0;
#P connect 33 0 23 0;
#P fasten 23 1 22 0 443 323 405 323;
#P connect 33 0 19 0;
#P fasten 19 1 18 0 458 372 420 372;
#P connect 34 0 35 0;
#P connect 35 0 33 0;
#P fasten 31 1 30 0 544 273 498 273;
#P connect 33 0 31 0;
#P connect 33 0 21 0;
#P fasten 21 1 20 0 553 322 515 322;
#P connect 33 0 13 0;
#P fasten 13 1 12 0 570 372 532 372;
#P pop;
#P newobj 142 352 51 196617 p TexGen;
#N vpatcher 438 325 1210 771;
#P origin -1 0;
#P button 1 74 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 281 252 100 196617 Scale;
#P comment 617 325 100 196617 Texture;
#P comment 219 169 100 196617 RotateXYZ;
#P newex 371 35 52 196617 r dimmer;
#B color 5;
#P window linecount 0;
#P message 494 301 80 196617 setall 0 0 , bang;
#P newex 494 324 117 196617 jit.matrix 2 char 15 15;
#P newex 147 274 134 196617 jit.expr @expr "1" "1" "1";
#P newex 147 248 130 196617 jit.matrix 3 float32 15 15;
#P window linecount 1;
#P newex 85 188 196 196617 jit.expr @expr "norm[0]" "norm[1]" "0";
#P window linecount 0;
#P newex 85 167 130 196617 jit.matrix 3 float32 15 15;
#P window linecount 1;
#P newex 18 98 287 196617 jit.expr @expr "(norm[0]-0.5)* 3." "(norm[1]-0.5)*3." "0";
#P newex 18 74 130 196617 jit.matrix 3 float32 15 15;
#P inlet 92 36 15 0;
#P outlet 494 346 15 0;
#P outlet 147 296 15 0;
#P outlet 85 210 15 0;
#P outlet 18 132 15 0;
#P window linecount 0;
#P comment 157 76 100 196617 Position;
#P connect 14 0 6 0;
#P connect 5 0 6 0;
#P connect 18 0 7 0;
#P connect 6 0 7 0;
#P connect 7 0 1 0;
#P connect 14 0 8 0;
#P connect 5 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 2 0;
#P connect 14 0 10 0;
#P connect 5 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 3 0;
#P connect 5 0 13 0;
#P connect 13 0 12 0;
#P connect 14 0 12 0;
#P connect 12 0 4 0;
#P pop;
#P newobj 246 177 79 196617 p GenGLParams;
#P newex 85 357 48 196617 loadbang;
#P message 172 190 65 196617 getglparams;
#P user jit.fpsgui 43 223 60 196617 0;
#P message 52 506 34 196617 reset;
#P newex 52 525 255 196617 jit.gl.handle foo @inherit_transform 1 @auto_rotate 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 2;
#P comment 33 41 136 196626 Turn on metro to see;
#P toggle 476 525 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 476 543 55 196617 floating $1;
#P toggle 403 525 15 0;
#P newex 364 524 35 196617 sel 27;
#P message 403 543 68 196617 fullscreen $1;
#P newex 321 567 188 196617 jit.window foo @depthbuffer 1 @sync 0;
#P newex 319 524 40 196617 key;
#P number 75 106 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 34 106 15 0;
#P newex 34 128 51 196617 qmetro 2;
#P newex 34 150 58 196617 t b b erase;
#P newex 34 567 271 196617 jit.gl.render foo @erase_color 1. 1. 1. 1. @camera 0 0 -6;
#P button 85 385 15 0;
#P button 246 157 15 0;
#P window linecount 2;
#P newex 85 411 403 196617 jit.gl.gridshape foo @shape plane @lighting_enable 0 @blend_enable 1 @smooth_shading 1 @automatic 0 @depth_enable 1 @dim 10 10 @name me @texture t3;
#P newex 159 235 227 196617 jit.gl.multiple foo 4 @targetname me @glparams position rotatexyz scale texture @texture t3;
#P window linecount 1;
#P comment 382 293 125 196617 < = toggle draw/draw_raw;
#P user panel 272 265 38 22;
#X brgb 229 152 152;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 136 348 64 25;
#X brgb 229 152 152;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 10 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 7 0;
#P fasten 8 2 7 0 87 173 39 173;
#P fasten 20 0 7 0 57 554 39 554;
#P connect 8 1 22 0;
#P connect 21 0 20 0;
#P connect 49 0 20 0;
#P connect 11 0 9 1;
#P connect 24 0 6 0;
#P connect 55 1 4 0;
#P lcolor 2;
#P connect 75 0 4 0;
#P connect 65 0 4 0;
#P connect 66 0 4 0;
#P connect 60 0 4 0;
#P connect 6 0 4 0;
#P connect 58 0 4 0;
#P connect 63 0 4 0;
#P connect 8 1 55 0;
#P connect 50 0 49 0;
#P fasten 24 0 37 0 90 380 112 380;
#P fasten 53 0 51 0 222 315 147 315;
#P fasten 52 0 51 0 282 315 147 315;
#P connect 55 2 51 0;
#P connect 51 0 26 0;
#P fasten 23 0 3 0 177 221 164 221;
#P fasten 27 0 3 0 165 221 164 221;
#P connect 25 0 3 0;
#P fasten 24 0 85 0 90 380 173 380;
#P connect 54 0 53 0;
#P fasten 25 1 3 1 274 218 236 218;
#P connect 51 0 56 0;
#P connect 38 0 5 0;
#P connect 5 0 25 0;
#P connect 87 0 52 0;
#P connect 64 0 63 0;
#P fasten 25 2 3 2 297 212 308 212;
#P fasten 14 0 13 0 408 562 326 562;
#P fasten 17 0 13 0 481 562 326 562;
#P connect 40 0 39 0;
#P connect 39 0 41 0;
#P fasten 12 0 15 0 324 543 361 543 361 522 369 522;
#P fasten 25 3 3 3 320 206 380 206;
#P fasten 15 0 16 0 369 542 400 542 400 522 408 522;
#P connect 16 0 14 0;
#P fasten 57 1 58 0 471 378 440 378;
#P connect 42 0 46 0;
#P connect 46 0 47 0;
#P connect 18 0 17 0;
#P connect 45 0 43 0;
#P connect 43 0 42 1;
#P connect 80 0 45 0;
#P connect 44 0 42 2;
#P connect 46 1 48 0;
#P connect 45 0 44 0;
#P connect 61 0 60 0;
#P connect 84 0 61 0;
#P connect 68 0 65 1;
#P connect 83 0 68 0;
#P connect 62 0 33 0;
#P connect 74 0 66 1;
#P connect 70 0 65 2;
#P fasten 33 0 32 1 568 195 593 195;
#P connect 83 0 67 0;
#P connect 67 0 66 2;
#P connect 62 0 34 0;
#P connect 81 0 62 0;
#P connect 73 0 65 3;
#P fasten 34 0 32 2 608 195 618 195;
#P connect 86 0 80 0;
#P connect 69 0 66 3;
#P fasten 76 0 75 1 602 349 630 349;
#P fasten 35 0 32 3 646 195 643 195;
#P connect 72 0 65 4;
#P connect 62 0 35 0;
#P connect 86 0 81 0;
#P fasten 77 0 75 2 642 349 658 349;
#P connect 71 0 66 4;
#P connect 82 0 72 0;
#P connect 82 0 71 0;
#P fasten 78 0 75 3 680 349 686 349;
#P fasten 32 0 36 0 568 219 690 219;
#P connect 28 0 36 0;
#P connect 87 0 83 0;
#P fasten 29 0 28 1 690 195 718 195;
#P connect 87 0 84 0;
#P connect 87 0 82 0;
#P fasten 30 0 28 2 730 195 746 195;
#P fasten 31 0 28 3 768 195 774 195;
#P pop;

thanks
Nadav


Viewing 1 post (of 1 total)