Forums > Jitter

Zone-tracking 2 quads-movement

September 23, 2008 | 4:46 pm

Hello,

I have a patch that make width & height variations on quads.

I would like to apply these variations only in a zone defined by a matrix (this could be mouse drawing or camera tracking).

I tryed a solution with jit.alphablend to define the zone, but this seems not the way for quads.

How can to tell to quads: "move (apply expression) in that zone only" ?

Many thanks.

#P window setfont "Sans Serif" 9.;
#P flonum 114 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname x;
#P flonum 77 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname y;
#P window linecount 1;
#N vpatcher 20 74 446 280;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 50 86 64 196617 jit.op @op +;
#P window linecount 2;
#P newex 102 50 279 196617 jit.expr @inputs 3 @expr "(cell[0]%4.>0.)*(cell[0]%4.<3.) * -0.25" "(cell[0]%4>1) * 0.25";
#P inlet 50 23 15 0;
#P outlet 50 108 15 0;
#P connect 1 0 3 0;
#P connect 3 0 0 0;
#P connect 1 0 2 0;
#P connect 2 0 3 1;
#P pop;
#P newobj 277 213 58 196617 p texcoord;
#N vpatcher 10 59 610 459;
#P inlet 489 97 15 0;
#P inlet 424 95 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 87 293 67 196617 jit.op @op +;
#P comment 200 253 25 196617 xyz;
#P newex 154 228 30 196617 t b s;
#P newex 144 253 53 196617 jit.pack 3;
#P window setfont "Sans Serif" 14.;
#P comment 275 140 16 196622 z;
#P comment 213 140 16 196622 y;
#P comment 153 140 16 196622 x;
#P window setfont "Sans Serif" 9.;
#P user jit.fpsgui 266 111 60 196617 4;
#P user jit.fpsgui 205 111 60 196617 4;
#P user jit.fpsgui 144 111 60 196617 4;
#P newex 144 88 193 196617 jit.unpack 3;
#P newex 192 172 242 196617 jit.expr @expr "2*(((cell[0])%4)>1.)*in[1]-in[1]";
#P newex 144 200 355 196617 jit.expr @expr "2*((cell[0]%4.!=1.)*(cell[0]%4.!=2.))*in[1]-in[1]";
#P inlet 87 50 15 0;
#P outlet 87 324 15 0;
#P connect 1 0 0 0;
#P connect 14 0 0 0;
#P connect 1 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P connect 12 0 11 0;
#P connect 2 0 11 0;
#P connect 11 0 14 1;
#P connect 3 0 12 0;
#P connect 12 1 11 1;
#P fasten 6 0 3 0 210 155 197 155;
#P fasten 4 1 6 0 210 109 210 109;
#P connect 4 2 7 0;
#P connect 15 0 3 1;
#P connect 16 0 2 1;
#P pop;
#P newobj 39 208 56 196617 p vertices;
#P user jit.fpsgui 279 357 60 196617 2;
#P user jit.fpsgui 217 357 60 196617 4;
#P message 406 189 31 196617 0.2;
#P message 474 209 14 196617 1;
#P user jit.fpsgui 155 357 60 196617 3;
#P newex 277 114 124 196617 jit.matrix 2 float32 20 5;
#N vpatcher 50 119 315 331;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 154 47 48 196617 loadbang;
#P message 154 68 31 196617 0.25;
#P window linecount 0;
#P newex 124 149 70 196617 snapshot~ 10;
#P newex 51 149 70 196617 snapshot~ 10;
#P newex 51 128 52 196617 +~ 0.125;
#P newex 51 107 34 196617 /~ 8.;
#P newex 51 86 40 196617 cycle~;
#P newex 124 128 52 196617 +~ 0.125;
#P newex 124 107 34 196617 /~ 8.;
#P newex 124 86 40 196617 cycle~;
#P inlet 91 44 15 0;
#P outlet 124 171 15 0;
#P outlet 51 171 15 0;
#P connect 2 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 0 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 10 0;
#P connect 10 0 1 0;
#P connect 12 0 11 0;
#P connect 11 0 3 1;
#P pop;
#P newobj 406 242 53 196617 p cycle~;
#P newex 449 267 40 196617 pvar y;
#P newex 406 267 40 196617 pvar x;
#P newex 39 65 114 196617 jit.unpack 2 @jump 3 2;
#P newex 277 93 177 196617 jit.expr @expr "norm[0]" "norm[1]";
#P newex 128 306 104 196617 jit.pack 2 @jump 3 2;
#P user ezdac~ 474 229 518 262 0;
#P flonum 406 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 522 165 48 196617 loadbang;
#P message 522 244 31 196617 0.25;
#P newex 39 23 43 196617 r baang;
#B color 5;
#P newex 39 92 199 196617 jit.expr @expr "snorm[0]" "snorm[1]" 0.;
#P newex 39 44 118 196617 jit.matrix 5 float32 5 5;
#P newex 39 115 124 196617 jit.matrix 3 float32 20 5;
#P newex 128 392 378 196617 jit.gl.mesh texco @texture tex11 @draw_mode quads @color 1. 1. 1. 1. @layer 2;
#P comment 446 208 19 196617 Hz;
#P fasten 7 0 19 0 527 185 411 185;
#P fasten 7 0 18 0 527 205 479 205;
#P connect 7 0 6 0;
#P fasten 6 0 13 0 527 264 411 264;
#P fasten 6 0 14 0 527 264 454 264;
#P connect 10 0 1 0;
#P fasten 10 0 17 0 133 328 160 328;
#P fasten 10 0 20 0 133 328 222 328;
#P fasten 10 0 21 0 133 327 284 327;
#P fasten 22 0 10 0 44 271 133 271;
#P connect 16 0 23 0;
#P connect 25 0 22 2;
#P connect 24 0 22 1;
#P connect 2 0 22 0;
#P fasten 23 0 10 1 282 268 227 268;
#P connect 5 0 3 0;
#P connect 3 0 12 0;
#P connect 12 0 4 0;
#P connect 4 0 2 0;
#P fasten 12 1 11 0 96 87 282 87;
#P connect 11 0 16 0;
#P connect 19 0 8 0;
#P connect 8 0 15 0;
#P connect 15 0 13 0;
#P connect 15 1 14 0;
#P connect 18 0 9 0;
#P window clipboard copycount 26;


Viewing 1 post (of 1 total)