XML Feeds

.

[jitter] sharing is fun - inverting an infinite tiling around a circle

Adam Murray adamjmurray at gmail.com
Thu Jan 3 22:27:37 MST 2008


This is my first jitter patch of any worth. Open a file, click play, and zoom away. I like wheel.mov and dishes.mov zoomed in. 

Basically, it takes a polar coordinate (r,theta) and swaps it with (1/r, theta). The video/image is tiled using appropriate jit.repos boundmodes so that all points out to infinity are valid (within computation limits). Changing the radius r (the zoom control in my patch) makes for a nice effect. 

There are a couple strange things about this patch I don't understand. In the GenerateMap subpatch, I am having trouble initializing the transformation matrix. After the exprfill, I have to bang the starting matrix twice for some reason and it seems there needs to be a delay in between. Also, trying to initialize it with a loadbang doesn't seem to work. Even with a delay and deferlow. Note that if you click the zoom control it will correct the problem, but I want it to work immediately after loading a file and clicking play. Anyone have any ideas on that? 

Any other suggestions are appreciated, as I am still learning Jitter.

Adam

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 618 152 53 196617 pvar play;
#P window setfont "Fixedwidth Serif" 10.;
#P message 160 94 106 1441802 read traffic.mov;
#P window setfont "Sans Serif" 12.;
#P comment 283 25 36 196620 Play;
#P toggle 283 44 40 0;
#P objectname play;
#P window setfont "Sans Serif" 9.;
#P newex 29 105 53 196617 pvar play;
#P comment 493 47 30 196617 fold;
#P comment 493 64 30 196617 wrap;
#N vpatcher 262 248 523 416;
#P window setfont "Sans Serif" 9.;
#P newex 53 54 55 196617 select 1 0;
#P message 134 94 67 196617 boundmode 4;
#P message 53 95 67 196617 boundmode 2;
#P inlet 53 30 15 0;
#P outlet 85 131 15 0;
#P connect 1 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 0 0;
#P connect 3 0 0 0;
#P connect 4 1 3 0;
#P pop;
#P newobj 368 175 81 196617 p wrapmodectrl;
#P newex 368 155 80 196617 pvar wrapmode;
#P user radiogroup 477 45 18 32;
#X size 2;
#X offset 16;
#X inactive 0;
#X itemtype 0;
#X flagmode 0;
#X set 0;
#X done;
#P objectname wrapmode;
#N vpatcher 481 94 754 466;
#P window setfont "Sans Serif" 9.;
#P newex 54 75 20 196617 t b;
#P newex 122 137 45 196617 onebang;
#P message 181 256 48 196617 set 1 \$1;
#P newex 54 252 87 196617 scale 0. 1. 0.5 8.;
#P message 66 168 46 196617 0. 5000;
#P message 54 101 62 196617 0. \, 1. 5000;
#P newex 54 190 40 196617 line 0.;
#P inlet 54 55 15 0;
#P inlet 185 50 15 0;
#P outlet 181 276 15 0;
#P outlet 54 274 15 0;
#P connect 3 0 10 0;
#P connect 10 0 5 0;
#P connect 5 0 4 0;
#P connect 6 0 4 0;
#P connect 4 0 7 0;
#P fasten 2 0 7 0 190 241 59 241;
#P connect 7 0 0 0;
#P connect 9 0 6 0;
#P fasten 4 1 9 0 89 211 117 211 117 131 127 131;
#P fasten 5 0 9 1 59 122 162 122;
#P connect 4 0 8 0;
#P connect 8 0 1 0;
#P pop;
#P newobj 547 127 58 196617 p zoomctrl;
#P newex 547 105 76 196617 pvar autozoom;
#P newex 616 126 57 196617 pvar zoom;
#P message 331 121 57 196617 auto-zoom;
#P objectname autozoom;
#P user jit.pwindow 366 226 322 242 0 1 0 0 1 0;
#P user jit.pwindow 28 227 322 242 0 1 0 0 1 0;
#P comment 426 49 25 196617 in;
#P user multiSlider 391 48 33 89 0. 1. 1 2681 47 0 0 2 0 40 0;
#M frgb 11 0 198;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P objectname zoom;
#P window setfont "Fixedwidth Serif" 10.;
#P message 142 74 94 1441802 read wheel.mov;
#P message 123 52 100 1441802 read dishes.mov;
#P window setfont "Sans Serif" 9.;
#N vpatcher 169 149 777 552;
#P origin 0 -6;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 178 98 49 196617 Issue 2:;
#P comment 162 278 244 196617 multiply to increase circle radius (the zoom effect);
#P window linecount 0;
#P newex 170 76 54 196617 onebang 1;
#P newex 113 105 55 196617 delay 250;
#P newex 170 49 20 196617 t b;
#P inlet 170 25 15 0;
#P newex 170 156 142 196617 jit.matrix 2 float32 320 240;
#P newex 57 134 29 196617 t b f;
#P message 10 236 39 196617 val \$1;
#P newex 57 277 99 196617 jit.op @op * @val 1;
#P message 170 132 278 196617 exprfill 0 "2*norm[0]-1" \, exprfill 1 "2*norm[1]-1" \, bang;
#P window linecount 3;
#P comment 359 312 208 196617 transform to an x \, y deltas matrix for mode 1 of jit.repos (assumes initial exprfilled matrix goes from -1 to 1 on both axes);
#P window linecount 2;
#P newex 57 314 287 196617 jit.expr @expr "in[0].p[0]*dim[0]/2. + dim[0]/2.-norm[0]*dim[0]" "in[0].p[1]*dim[1]/2.+dim[1]/2.-norm[1]*dim[1]";
#P window linecount 1;
#P newex 57 234 140 196617 jit.expr @expr "in[0]/in[1]";
#P newex 187 205 349 196617 jit.expr @inputs 1 @expr "(in[0].p[0]*in[0].p[0])+(in[0].p[1]*in[0].p[1])";
#P inlet 57 95 15 0;
#P outlet 57 354 15 0;
#P comment 202 226 230 196617 calculate 1/conj(z) = x/(x^2+y^2) \, y/(x^2+y^2);
#P window linecount 0;
#P comment 316 152 141 196617 fill with x \, y coordinates from -1 to 1 on both axes;
#P comment 178 112 277 196617 I can't figure out why the second delayed bang is necessary;
#P comment 200 56 188 196617 loadbang here doesn't seem to work!;
#P comment 200 42 49 196617 Issue 1:;
#P connect 14 1 13 0;
#P connect 6 0 14 0;
#P connect 15 0 8 0;
#P connect 14 0 8 0;
#P connect 8 0 12 0;
#P connect 13 0 12 0;
#P connect 12 0 9 0;
#P connect 9 0 5 0;
#P connect 19 0 18 0;
#P connect 16 0 17 0;
#P connect 17 0 19 0;
#P connect 19 0 11 0;
#P connect 11 0 15 0;
#P connect 18 0 15 0;
#P connect 15 0 7 0;
#P connect 7 0 8 1;
#P pop;
#P newobj 547 173 81 196617 p MapGenerator;
#P window setfont "Sans Serif" 10.;
#P message 204 117 33 196618 read;
#P window setfont "Sans Serif" 9.;
#P newex 29 129 52 196617 metro 50;
#P newex 29 165 103 196617 jit.qt.movie 320 240;
#P window setfont "Fixedwidth Serif" 10.;
#P message 106 30 133 1441802 read colorswatch.pict;
#P newex 367 199 190 1441802 jit.repos @mode 1 @boundmode 4;
#B color 5;
#P window setfont "Sans Serif" 12.;
#P comment 352 79 51 196620 Zoom;
#P window setfont "Sans Serif" 9.;
#P comment 426 124 25 196617 out;
#P window setfont "Sans Serif" 12.;
#P comment 455 27 77 196620 Wrap Mode;
#P user panel 278 21 257 122;
#X brgb 205 235 241;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 100 21 172 120;
#X brgb 231 228 182;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 30 0 10 1;
#P connect 20 1 18 0;
#P connect 18 0 20 1;
#P connect 10 0 5 1;
#P connect 20 0 10 0;
#P connect 19 0 20 0;
#P connect 22 0 23 0;
#P connect 5 0 16 0;
#P connect 23 0 5 0;
#P fasten 7 0 5 0 34 196 372 196;
#P connect 7 0 15 0;
#P fasten 29 0 7 0 165 154 34 154;
#P connect 8 0 7 0;
#P fasten 9 0 7 0 209 154 34 154;
#P fasten 6 0 7 0 111 154 34 154;
#P fasten 11 0 7 0 128 154 34 154;
#P fasten 12 0 7 0 147 154 34 154;
#P connect 26 0 8 0;
#P window clipboard copycount 31;







More information about the jitter mailing list