Motion to 3D planes patch example

Mar 8, 2006 at 12:04am

Motion to 3D planes patch example

Hi everyone,

Work in progress here that I thought I’d share, since it is relevant to a number of questions people have been asking. Basically, what the patch does is this:

1. “Tracks” motion by turning a video input into black and white. I intended this for use with dancers, hand movements, or any other moving object against a blank, contrasting background. (Not real motion tracking, but a simple trick that made sense here for preserving whole outlines.)

2. Translates the black (or white) pixels to a series of vertices for use as OpenGL geometry.

3. Renders overlapping planes in 3D; here mapped to a quasi-particle system by using an image of a dot.

That wouldn’t be that exciting, but the effect looks nice after adding some Z-plane randomization for a live-sketched feel.

If that didn’t make sense, feel free to have a look at it. Since this doesn’t look like much without the image, I’ve zipped this up with the image file source and placed it here:

http://www.createdigitalmusic.com/max/motion3dplanes.zip

It’s especially fun if you change the texture source or use colors like light orange.

This is just one of a number of ideas I’m working on, but I’d love some feedback on how I’m doing this. Specifically:

* Is there a way to make this more efficient? I thought of using mesh in place of gridshapes, but I’m new to this and didn’t immediately know how to format the matrix with vertices for mesh.

* I tried using a Wacom external to use tablet input for parameters, but couldn’t get polling speed right . . . should I hook up Wacom to a separate metro object instead of qmetro? (This reveals some things I don’t fully grasp about how Jitter schedules events.)

* Next step for me would be to do the reverse visual effect, to create a particle system that “avoided” either black or white pixels. I know how to measure distance from a single point, a la the marbles example in the documentation, but I’m still wrapping my head around calculating distance from edges . . . anyone have suggestions for which way to go?

Hope this is interesting and stimulating to, well, someone. Thanks!

#24769
Mar 8, 2006 at 1:33am

Hi Peter,
I took a look at your patch. The first thing I noticed in terms of
efficiency is your use of jit.iter. Avoid this object like the
plague. It will really slow you down if you have a matrix of any
size. I’ve done similar things in the past ->taking video, extracting
cells, drawing a geometry. In the end, I created some jitter
externals to do this because I wanted to stay in matrix land and the
basic jitter objects don’t really lend themselves to doing this
efficiently. Here’s a modified patch that uses 2 objects I created.
It runs alot faster now. Hopefully, it’s what you were going for and
you’ll find it usefull. The 2 objects I used were xray.jit.cellcoords
and xray.jit.line2quad. The first extracts white pixels (you could
easily extract the black pixels by inverting the matrix). The second
takes a line a generates a quad as well as the appropriate texture
coordinates. This is what redraws the video as circles with your png
texture. If you don;’t already have the externals, you can get them
at http://www.mat.ucsb.edu/~whsmith/xray.html . Admittedly, there are
a few things I had to do to adapt to my object’s input type that are a
slight knock on efficiency such as the jit.transpose. Also, if there
was an object that created a quad from a point, then the jit.op
wouldn’t be needed. In any case, below is the patch.

enjoy,
wes

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 24 592 55 196617 delay 200;
#P hidden newex 39 566 20 196617 t b;
#P newex 100 642 143 196617 xray.jit.line2quad @scale 1 1;
#B color 5;
#P newex 105 498 53 196617 jit.concat;
#P newex 138 477 121 196617 jit.op @op + pass @val 1;
#P newex 112 428 180 196617 jit.matrix 2 float32 1000 1 @adapt 0;
#P newex 115 451 68 196617 jit.transpose;
#P newex 100 614 53 196617 jit.pack 3;
#P newex 100 582 63 196617 jit.unpack 2;
#P newex 100 560 133 196617 jit.op @op – + @val 0.5 0.5;
#P newex 206 536 54 196617 pack 0. 0.;
#P newex 247 510 45 196617 / -120.;
#P newex 203 510 40 196617 / 160.;
#P newex 100 522 65 196617 jit.op @op *;
#P comment 583 739 35 196617 height;
#P flonum 512 719 59 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 575 719 59 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 3;
#P hidden message 0 678 72 196617 getdest_dim , getcamera , getlens_angle;
#P window linecount 1;
#N vpatcher 385 97 759 364;
#P outlet 131 150 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 131 128 29 196617 * 1.;
#P window linecount 1;
#P message 270 77 20 196617 $2;
#P message 248 77 20 196617 $1;
#P newex 248 95 32 196617 / 1.;
#P message 102 70 20 196617 $3;
#P newex 50 92 184 196617 expr $f2*2*tan($f1/2*3.1415/180);
#P newex 50 50 164 196617 route lens_angle camera dest_dim;
#P inlet 50 30 15 0;
#P outlet 166 152 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 1 4 0;
#P fasten 3 0 8 0 55 115 136 115;
#P connect 8 0 9 0;
#P fasten 5 0 8 1 253 118 155 118;
#P fasten 3 0 0 0 55 115 171 115;
#P fasten 4 0 3 1 107 88 229 88;
#P fasten 2 2 6 0 157 73 253 73;
#P connect 6 0 5 0;
#P fasten 2 2 7 0 157 73 275 73;
#P connect 7 0 5 1;
#P pop;
#P newobj 568 694 76 196617 p CalcGLHeight;
#P comment 515 739 35 196617 width;
#P newex 108 397 95 196617 xray.jit.cellcoords;
#N vpatcher 744 371 1351 995;
#P window setfont “Sans Serif” 9.;
#P message 409 348 64 196617 74 255 120;
#P newex 121 353 62 196617 prepend set;
#P message 408 412 30 196617 read;
#P message 408 391 35 196617 write;
#P message 408 371 44 196617 clearall;
#N vpreset 3;
#P preset 353 384 47 27;
#P newex 33 452 58 196617 append 0.3;
#P newex 33 428 71 196617 prepend color;
#N comlet RGB color float;
#P outlet 33 481 15 0;
#P newex 33 404 61 196617 pak 0. 0. 0.;
#P newex 207 377 82 196617 expr $i1 / 255.;
#P newex 121 377 82 196617 expr $i1 / 255.;
#P newex 33 377 82 196617 expr $i1 / 255.;
#P newex 33 353 67 196617 unpack 0 0 0;
#P user swatch 33 64 447 281;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 3 0 5 1;
#P connect 4 0 5 2;
#P connect 0 0 13 0;
#P connect 1 1 3 0;
#P connect 1 2 4 0;
#P hidden connect 12 0 9 0;
#P hidden connect 11 0 9 0;
#P hidden connect 10 0 9 0;
#P hidden connect 13 0 14 0;
#P pop;
#P newobj 156 267 64 196617 p drawcolor;
#P message 409 749 68 196617 fullscreen $1;
#P toggle 392 749 15 0;
#P newex 355 749 35 196617 sel 27;
#P newex 313 749 40 196617 key;
#N vpatcher 684 124 1280 647;
#P user jit.pwindow 39 331 82 62 0 1 0 0 1 0;
#N comlet Texture info to gridshape;
#P hidden outlet 10 312 15 0;
#P window setfont “Sans Serif” 9.;
#P hidden newex 18 227 20 196617 t b;
#P hidden message 43 45 14 196617 1;
#P hidden message 25 45 14 196617 6;
#P number 66 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 25 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden message 25 146 92 196617 blend_mode $1 $2;
#P hidden newex 25 118 43 196617 pak 0 0;
#P window linecount 1;
#P message 170 193 57 196617 read , bang;
#P hidden newex 10 24 48 196617 loadbang;
#P message 10 194 158 196617 read dot_matrix_alpha.png , bang;
#P hidden newex 10 278 154 196617 jit.gl.texture space @dim 32 32;
#P window linecount 0;
#P hidden newex 10 252 93 196617 jit.qt.movie 32 32;
#P comment 18 173 132 196617 Texture from image/movie;
#P comment 25 72 100 196617 Blend mode;
#P hidden connect 5 0 4 0;
#P hidden fasten 13 0 2 0 23 248 15 248;
#P hidden fasten 6 0 2 0 175 215 15 215;
#P hidden connect 4 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 3 0 14 0;
#P hidden fasten 8 0 14 0 30 166 230 166 230 302 15 302;
#P hidden fasten 7 0 13 0 30 141 5 141 5 215 23 215;
#P hidden connect 5 0 11 0;
#P hidden connect 11 0 9 0;
#P hidden connect 9 0 7 0;
#P hidden connect 7 0 8 0;
#P connect 2 0 15 0;
#P hidden connect 5 0 12 0;
#P hidden fasten 10 0 7 1 71 112 63 112;
#P hidden fasten 12 0 10 0 48 65 71 65;
#P pop;
#P newobj 97 267 52 196617 p texture;
#N vpatcher 83 282 683 682;
#P origin 0 -1;
#P user jit.pwindow 411 213 82 62 0 1 0 0 1 0;
#P toggle 414 185 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 437 184 29 196617 gate;
#N comlet Preview matrix in;
#P hidden inlet 456 31 15 0;
#P hidden message 476 150 59 196617 getinputlist;
#P hidden message 409 150 59 196617 getvdevlist;
#P window linecount 0;
#P hidden newex 409 100 48 196617 loadbang;
#P button 409 128 15 0;
#P window linecount 1;
#P hidden newex 96 81 25 196617 iter;
#P hidden newex 191 104 38 196617 t clear;
#P hidden newex 329 104 38 196617 t clear;
#P hidden message 251 152 45 196617 input $1;
#P user ubumenu 251 128 145 196617 0 1 1 0;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P hidden newex 251 104 75 196617 prepend append;
#P hidden newex 251 81 25 196617 iter;
#P hidden message 96 152 58 196617 vdevice $1;
#P user ubumenu 96 128 145 196617 0 1 1 0;
#X add;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P hidden newex 96 104 75 196617 prepend append;
#P hidden newex 96 53 112 196617 route vdevlist inputlist;
#N comlet Setup in;
#P hidden inlet 96 28 17 0;
#N comlet Settings out;
#P hidden outlet 22 194 15 0;
#P message 22 128 46 196617 settings;
#P window linecount 0;
#P comment 20 107 100 196617 Camera setup;
#P comment 428 128 100 196617 Update input list;
#P hidden connect 2 0 3 0;
#P hidden fasten 8 0 3 0 101 175 27 175;
#P hidden fasten 12 0 3 0 256 175 27 175;
#P hidden fasten 18 0 3 0 414 175 27 175;
#P hidden fasten 19 0 3 0 481 175 27 175;
#P hidden connect 4 0 5 0;
#P hidden connect 5 0 15 0;
#P hidden connect 15 0 6 0;
#P hidden connect 6 0 7 0;
#P hidden fasten 14 0 7 0 196 124 101 124;
#P hidden connect 7 0 8 0;
#P hidden fasten 5 0 14 0 101 77 196 77;
#P hidden fasten 5 1 9 0 152 73 256 73;
#P hidden connect 9 0 10 0;
#P hidden connect 10 0 11 0;
#P hidden fasten 13 0 11 0 334 123 256 123;
#P hidden connect 11 0 12 0;
#P hidden fasten 5 1 13 0 152 73 334 73;
#P hidden connect 17 0 16 0;
#P hidden connect 16 0 18 0;
#P hidden connect 21 0 23 0;
#P hidden connect 22 0 21 0;
#P hidden connect 20 0 21 1;
#P hidden fasten 16 0 19 0 414 146 481 146;
#P pop;
#P newobj 156 67 60 196617 p camsetup;
#P flonum 100 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 335 699 100 196617 Draw planes at black/white pixels;
#P window linecount 1;
#P newex 108 373 130 196617 jit.matrix 1 float32 80 60;
#P toggle 336 154 15 0;
#P newex 359 153 29 196617 gate;
#P user jit.pwindow 334 172 82 62 0 1 0 0 1 0;
#P newex 314 774 153 196617 jit.window space @fsmenubar 0;
#P window linecount 2;
#P newex 87 765 213 196617 jit.gl.render space @erase_color 0. 0. 0.
0.1 @color 1. 1. 1. 0.1 @blend_enable 1;
#P window linecount 1;
#P newex 67 735 50 196617 t b erase;
#P window linecount 2;
#P newex 81 676 241 196617 jit.gl.mesh space @draw_mode quads
@blend_enable 1 @lighting_enable 1 @color 1 1 1 1;
#P window linecount 5;
#P comment 430 581 100 196617 Convert to usable OpenGL X , Y
coordinates ; randomly generate Z coordinates;
#P window linecount 1;
#P hidden message 575 57 14 196617 1;
#P hidden newex 575 31 48 196617 loadbang;
#P user ubumenu 100 184 100 196617 0 1 1 0;
#X setrgb 31 31 31 221 221 221 234 234 234 4 4 4 141 141 141 112 112 112;
#X add Track white;
#X add Track black;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 108 323 66 196617 jit.rgb2luma;
#P number 100 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Lucida Grande” 14.;
#P comment 437 265 100 67108878 Appearance;
#P comment 438 146 100 67108878 Options;
#P window setfont “Sans Serif” 9.;
#P newex 108 347 103 196617 jit.op @op > @val 50;
#P window setfont “Lucida Grande” 14.;
#P comment 439 30 100 67108878 Source;
#P window setfont “Sans Serif” 9.;
#P comment 277 44 131 196617 Movie File;
#P comment 122 44 40 196617 Camera;
#P toggle 253 43 15 0;
#P newex 253 67 57 196617 qmetro 30;
#P message 306 67 28 196617 read;
#P message 371 67 27 196617 stop;
#P message 337 67 31 196617 start;
#P newex 253 97 93 196617 jit.qt.movie 80 60;
#P message 197 42 31 196617 close;
#P message 166 42 28 196617 open;
#P toggle 100 43 15 0;
#P newex 100 67 49 196617 qmetro 2;
#P newex 100 97 86 196617 jit.qt.grab 80 60;
#P user panel 240 32 187 94;
#X brgb 190 190 190;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P comment 216 349 100 196617 Convert to B&W;
#P comment 137 157 130 196617 Black and white thresh;
#P window linecount 2;
#P comment 308 517 100 196617 Make list of black and white pixels;
#P window linecount 1;
#P comment 139 215 100 196617 Maximum Z range;
#P user panel 93 145 336 98;
#X brgb 190 190 190;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 88 141 347 106;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 93 33 140 93;
#X brgb 90 240 100;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 94 32 140 93;
#X brgb 90 240 100;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 87 26 347 106;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P window linecount 0;
#P comment 289 188 100 196617;
#P user panel 87 255 152 38;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P fasten 54 1 56 0 639 715 580 715;
#P hidden connect 32 0 33 0;
#P connect 37 1 54 0;
#P fasten 54 0 57 0 573 715 517 715;
#P fasten 49 0 50 0 408 764 408 749;
#P hidden fasten 48 0 49 0 360 771 397 771;
#P connect 26 0 42 0;
#P hidden fasten 26 0 40 1 113 366 330 366 330 149 383 149;
#P hidden connect 41 0 40 0;
#P fasten 47 0 48 0 354 766 354 751;
#P hidden connect 40 0 39 0;
#P hidden fasten 50 0 38 0 414 770 319 770;
#P fasten 20 0 17 0 311 89 258 89;
#P fasten 18 0 17 0 342 89 258 89;
#P fasten 19 0 17 0 376 89 258 89;
#P hidden fasten 21 0 36 0 258 89 72 89;
#P connect 21 0 17 0;
#P hidden connect 22 0 71 0;
#P connect 22 0 21 0;
#P connect 61 0 62 1;
#P connect 56 0 61 0;
#P connect 60 0 62 0;
#P hidden connect 12 0 30 0;
#P hidden fasten 12 0 45 1 105 120 226 120 226 62 211 62;
#P connect 57 0 60 0;
#P hidden fasten 29 0 26 1 105 175 206 175;
#P hidden connect 12 1 45 0;
#P connect 62 0 59 1;
#P connect 68 0 69 1;
#P connect 66 0 69 0;
#P connect 66 0 68 0;
#P fasten 64 1 65 1 131 606 126 606;
#P connect 67 0 66 0;
#P connect 52 0 67 0;
#P connect 70 1 35 1;
#P connect 42 0 52 0;
#P connect 30 0 26 0;
#P hidden fasten 17 0 30 0 258 120 113 120;
#P connect 65 0 70 0;
#P connect 64 0 65 0;
#P connect 63 0 64 0;
#P connect 59 0 63 0;
#P connect 69 0 59 0;
#P hidden fasten 33 0 31 0 580 137 105 137;
#P hidden fasten 16 0 12 0 202 89 105 89;
#P hidden fasten 15 0 12 0 171 89 105 89;
#P hidden fasten 13 0 36 0 105 91 72 91;
#P connect 13 0 12 0;
#P connect 14 0 13 0;
#P fasten 36 0 37 0 72 759 92 759;
#P fasten 36 1 37 0 112 759 92 759;
#P connect 55 0 37 0;
#P connect 70 0 35 0;
#P hidden fasten 46 0 35 0 102 322 86 322;
#P hidden fasten 51 0 35 0 161 322 86 322;
#P connect 71 0 72 0;
#P connect 72 0 55 0;
#P window clipboard copycount 73;

#72175
Mar 8, 2006 at 2:38am

Hi Wes,
Funny you should say that, because right after posting that I came across your externals and said . . . oh, duh, that’d be helpful. And yes, you had exactly the idea.

What about implementing the same thing as JavaScript? I’ve noticed a huge difference in performance there, particularly with anything recursive.

I’ve certainly seen which objects speed up / slow things down, and usually even test this. I don’t always have a sense of why. The JavaScript examples in Jitter seem to improve efficiency by reducing repeated instructions and recursive code. I guess that the problem with jit.iter is you suddenly have this huge list that has to get moved around from object to object, all the while being scheduled. (that, at least, SOUNDS nasty) Replacing jit.xfade with jit.op moves from CPU to GPU on operations that benefit from that, just to give another example . . .

Anyway, any additional light you can shed on the situation is appreciated. Thanks for sharing your fantastic externals; I’ll let you know how this turns out for me.

Cheers,
Peter

#72176
Mar 8, 2006 at 3:32am

> What about implementing the same thing as JavaScript? I’ve noticed a huge difference in performance there, particularly with anything recursive.
>

Sometimes you can model things more efficiently in JS than in a
patcher. This is where speedups occur. If you’re soing lots of
messaging or number crunching, this will definitely be a slow down.

>I guess that the problem with jit.iter is you suddenly have this huge
list that has to get moved around from object to object, all the while
being scheduled.

It’s due to the massive amounts of max messages

> (that, at least, SOUNDS nasty) Replacing jit.xfade with jit.op moves from CPU to GPU on operations that benefit from that, just to give another example . . .

not quite sure what you’re getting at here. Jit.xfade doesn’t operate
on the GPU. a shader that implemented a jit.xfade-like fragment
shader would be a good GPU speed up however

best,
wes

#72177
Mar 8, 2006 at 5:45am

I believe I mispoke. I’ve certainly benhmarked jit.op combining two matrices faster than jit.xfade. I meant working with video on GPU as a separate issue. Anyway, back to this patch . . .

Have worked with your modified patch more, and it looks great; made sense to me for the most part (taking it apart a little more and thinking through each step). I changed the mesh scale to 10 10 to account for a chance in scale elsewhere.

Now, my challenge is to recreate the effect of random values for the Z coordinates. I would naturally want to do this with a jit.noise matrix rather than the random object, since I’m happily back to matrices in place of lists.

I’m just honestly unsure of where/how to combine the noise matrix with the matrix that’s feeding line2quad. Your line2quad object does work with 3D data in mode 1, correct? So if I took the existing matrix and added in Z values, say between 0 and 1 or 0 and 0.5 or some other range . . .

(Sorry if this is a dumb question, just trying to think through the best place to glue in the Z values, again using as little CPU bandwidth as possible . . . )

This would presumably be useful, too, if someone wanted to map the color data to Z, or some other purpose I didn’t devise here, instead of choosing random Z values within a range as I’m doing.

Thanks, Wes, this is all really great. If California and New York were closer, I could buy you a drink . . .

#72178
Mar 8, 2006 at 7:09am

> I’m just honestly unsure of where/how to combine the noise matrix with the matrix that’s feeding line2quad. Your line2quad object does work with 3D data in mode 1, correct? So if I took the existing matrix and added in Z values, say between 0 and 1 or 0 and 0.5 or some other range . . .
>
> (Sorry if this is a dumb question, just trying to think through the best place to glue in the Z values, again using as little CPU bandwidth as possible . . . )
>

You can use it with 3d coordinates. Below is a simple modification to
do just that. The @mode 1 of xray.jit.line2quad is a bit quirky right
now and is something I need to fix up a little, bit I think it works
to decent effect in the patch. Potentially,you could do the random z
displacement in a shader as well. Your preference.

wes

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 150 735 193 196617 jit.gl.handle space @inherit_transform 1;
#P newex 294 593 108 196617 jit.op @op * @val 0.1;
#P user jit.fpsgui 25 487 60 196617 3;
#P button 294 549 15 0;
#P newex 294 570 128 196617 jit.noise 1 float32 2 1000;
#P newex 186 612 87 196617 pak scale 0.2 1.;
#P flonum 239 586 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 186 586 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user panel 183 583 41 21;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 236 583 41 21;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden newex 24 592 55 196617 delay 200;
#P hidden newex 39 566 20 196617 t b;
#P newex 100 642 289 196617 xray.jit.line2quad @scale 0.02 0.02 @mode
1 @normalize 0 0;
#B color 5;
#P newex 105 498 53 196617 jit.concat;
#P newex 138 477 121 196617 jit.op @op + pass @val 1;
#P newex 112 428 180 196617 jit.matrix 2 float32 1000 1 @adapt 0;
#P newex 115 451 68 196617 jit.transpose;
#P newex 100 614 53 196617 jit.pack 3;
#P newex 100 582 63 196617 jit.unpack 2;
#P newex 100 560 133 196617 jit.op @op – + @val 0.5 0.5;
#P newex 206 536 54 196617 pack 0. 0.;
#P newex 247 510 45 196617 / -120.;
#P newex 203 510 40 196617 / 160.;
#P newex 100 522 65 196617 jit.op @op *;
#P comment 583 739 35 196617 height;
#P flonum 512 719 59 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 575 719 59 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 3;
#P hidden message 0 678 72 196617 getdest_dim , getcamera , getlens_angle;
#P window linecount 1;
#N vpatcher 385 97 759 364;
#P outlet 131 150 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 131 128 29 196617 * 1.;
#P window linecount 1;
#P message 270 77 20 196617 $2;
#P message 248 77 20 196617 $1;
#P newex 248 95 32 196617 / 1.;
#P message 102 70 20 196617 $3;
#P newex 50 92 184 196617 expr $f2*2*tan($f1/2*3.1415/180);
#P newex 50 50 164 196617 route lens_angle camera dest_dim;
#P inlet 50 30 15 0;
#P outlet 166 152 15 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 1 4 0;
#P fasten 3 0 8 0 55 115 136 115;
#P connect 8 0 9 0;
#P fasten 5 0 8 1 253 118 155 118;
#P fasten 3 0 0 0 55 115 171 115;
#P fasten 4 0 3 1 107 88 229 88;
#P fasten 2 2 6 0 157 73 253 73;
#P connect 6 0 5 0;
#P fasten 2 2 7 0 157 73 275 73;
#P connect 7 0 5 1;
#P pop;
#P newobj 568 694 76 196617 p CalcGLHeight;
#P comment 515 739 35 196617 width;
#P newex 108 397 95 196617 xray.jit.cellcoords;
#N vpatcher 744 371 1351 995;
#P window setfont “Sans Serif” 9.;
#P message 409 348 64 196617 255 255 255;
#P newex 121 353 62 196617 prepend set;
#P message 408 412 30 196617 read;
#P message 408 391 35 196617 write;
#P message 408 371 44 196617 clearall;
#N vpreset 3;
#P preset 353 384 47 27;
#P newex 33 452 58 196617 append 0.3;
#P newex 33 428 71 196617 prepend color;
#N comlet RGB color float;
#P outlet 33 481 15 0;
#P newex 33 404 61 196617 pak 0. 0. 0.;
#P newex 207 377 82 196617 expr $i1 / 255.;
#P newex 121 377 82 196617 expr $i1 / 255.;
#P newex 33 377 82 196617 expr $i1 / 255.;
#P newex 33 353 67 196617 unpack 0 0 0;
#P user swatch 33 64 447 281;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 3 0 5 1;
#P connect 4 0 5 2;
#P connect 0 0 13 0;
#P connect 1 1 3 0;
#P connect 1 2 4 0;
#P hidden connect 12 0 9 0;
#P hidden connect 11 0 9 0;
#P hidden connect 10 0 9 0;
#P hidden connect 13 0 14 0;
#P pop;
#P newobj 156 267 64 196617 p drawcolor;
#P message 409 749 68 196617 fullscreen $1;
#P toggle 392 749 15 0;
#P newex 355 749 35 196617 sel 27;
#P newex 313 749 40 196617 key;
#N vpatcher 684 124 1280 647;
#P user jit.pwindow 39 331 82 62 0 1 0 0 1 0;
#N comlet Texture info to gridshape;
#P hidden outlet 10 312 15 0;
#P window setfont “Sans Serif” 9.;
#P hidden newex 18 227 20 196617 t b;
#P hidden message 43 45 14 196617 1;
#P hidden message 25 45 14 196617 6;
#P number 66 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 25 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden message 25 146 92 196617 blend_mode $1 $2;
#P hidden newex 25 118 43 196617 pak 0 0;
#P window linecount 1;
#P message 170 193 57 196617 read , bang;
#P hidden newex 10 24 48 196617 loadbang;
#P message 10 194 158 196617 read dot_matrix_alpha.png , bang;
#P hidden newex 10 278 154 196617 jit.gl.texture space @dim 32 32;
#P window linecount 0;
#P hidden newex 10 252 93 196617 jit.qt.movie 32 32;
#P comment 18 173 132 196617 Texture from image/movie;
#P comment 25 72 100 196617 Blend mode;
#P hidden connect 5 0 4 0;
#P hidden fasten 13 0 2 0 23 248 15 248;
#P hidden fasten 6 0 2 0 175 215 15 215;
#P hidden connect 4 0 2 0;
#P hidden connect 2 0 3 0;
#P hidden connect 3 0 14 0;
#P hidden fasten 8 0 14 0 30 166 230 166 230 302 15 302;
#P hidden fasten 7 0 13 0 30 141 5 141 5 215 23 215;
#P hidden connect 5 0 11 0;
#P hidden connect 11 0 9 0;
#P hidden connect 9 0 7 0;
#P hidden connect 7 0 8 0;
#P connect 2 0 15 0;
#P hidden connect 5 0 12 0;
#P hidden fasten 10 0 7 1 71 112 63 112;
#P hidden fasten 12 0 10 0 48 65 71 65;
#P pop;
#P newobj 97 267 52 196617 p texture;
#N vpatcher 83 282 683 682;
#P origin 0 -1;
#P user jit.pwindow 411 213 82 62 0 1 0 0 1 0;
#P toggle 414 185 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 437 184 29 196617 gate;
#N comlet Preview matrix in;
#P hidden inlet 456 31 15 0;
#P hidden message 476 150 59 196617 getinputlist;
#P hidden message 409 150 59 196617 getvdevlist;
#P window linecount 0;
#P hidden newex 409 100 48 196617 loadbang;
#P button 409 128 15 0;
#P window linecount 1;
#P hidden newex 96 81 25 196617 iter;
#P hidden newex 191 104 38 196617 t clear;
#P hidden newex 329 104 38 196617 t clear;
#P hidden message 251 152 45 196617 input $1;
#P user ubumenu 251 128 145 196617 0 1 1 0;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P hidden newex 251 104 75 196617 prepend append;
#P hidden newex 251 81 25 196617 iter;
#P hidden message 96 152 58 196617 vdevice $1;
#P user ubumenu 96 128 145 196617 0 1 1 0;
#X add;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P hidden newex 96 104 75 196617 prepend append;
#P hidden newex 96 53 112 196617 route vdevlist inputlist;
#N comlet Setup in;
#P hidden inlet 96 28 17 0;
#N comlet Settings out;
#P hidden outlet 22 194 15 0;
#P message 22 128 46 196617 settings;
#P window linecount 0;
#P comment 20 107 100 196617 Camera setup;
#P comment 428 128 100 196617 Update input list;
#P hidden connect 2 0 3 0;
#P hidden fasten 8 0 3 0 101 175 27 175;
#P hidden fasten 12 0 3 0 256 175 27 175;
#P hidden fasten 18 0 3 0 414 175 27 175;
#P hidden fasten 19 0 3 0 481 175 27 175;
#P hidden connect 4 0 5 0;
#P hidden connect 5 0 15 0;
#P hidden connect 15 0 6 0;
#P hidden connect 6 0 7 0;
#P hidden fasten 14 0 7 0 196 124 101 124;
#P hidden connect 7 0 8 0;
#P hidden fasten 5 0 14 0 101 77 196 77;
#P hidden fasten 5 1 9 0 152 73 256 73;
#P hidden connect 9 0 10 0;
#P hidden connect 10 0 11 0;
#P hidden fasten 13 0 11 0 334 123 256 123;
#P hidden connect 11 0 12 0;
#P hidden fasten 5 1 13 0 152 73 334 73;
#P hidden connect 17 0 16 0;
#P hidden connect 16 0 18 0;
#P hidden connect 21 0 23 0;
#P hidden connect 22 0 21 0;
#P hidden connect 20 0 21 1;
#P hidden fasten 16 0 19 0 414 146 481 146;
#P pop;
#P newobj 156 67 60 196617 p camsetup;
#P flonum 100 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 335 699 100 196617 Draw planes at black/white pixels;
#P window linecount 1;
#P newex 108 373 130 196617 jit.matrix 1 float32 80 60;
#P toggle 336 154 15 0;
#P newex 359 153 29 196617 gate;
#P user jit.pwindow 334 172 82 62 0 1 0 0 1 0;
#P newex 314 774 153 196617 jit.window space @fsmenubar 0;
#P window linecount 2;
#P newex 87 765 213 196617 jit.gl.render space @erase_color 0. 0. 0.
0.1 @color 1. 1. 1. 0.1 @blend_enable 1;
#P window linecount 1;
#P newex 67 735 50 196617 t b erase;
#P window linecount 2;
#P newex 81 676 245 196617 jit.gl.mesh space @draw_mode quads
@blend_enable 1 @lighting_enable 1 @color 1 1 1 1 @scale 1 1 1;
#P window linecount 5;
#P comment 430 581 100 196617 Convert to usable OpenGL X , Y
coordinates ; randomly generate Z coordinates;
#P window linecount 1;
#P hidden message 575 57 14 196617 1;
#P hidden newex 575 31 48 196617 loadbang;
#P user ubumenu 100 184 100 196617 0 1 1 0;
#X setrgb 31 31 31 221 221 221 234 234 234 4 4 4 141 141 141 112 112 112;
#X add Track white;
#X add Track black;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 108 323 66 196617 jit.rgb2luma;
#P number 100 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Lucida Grande” 14.;
#P comment 437 265 100 67108878 Appearance;
#P comment 438 146 100 67108878 Options;
#P window setfont “Sans Serif” 9.;
#P newex 108 347 103 196617 jit.op @op > @val 50;
#P window setfont “Lucida Grande” 14.;
#P comment 439 30 100 67108878 Source;
#P window setfont “Sans Serif” 9.;
#P comment 277 44 131 196617 Movie File;
#P comment 122 44 40 196617 Camera;
#P toggle 253 43 15 0;
#P newex 253 67 57 196617 qmetro 30;
#P message 306 67 28 196617 read;
#P message 371 67 27 196617 stop;
#P message 337 67 31 196617 start;
#P newex 253 97 93 196617 jit.qt.movie 80 60;
#P message 197 42 31 196617 close;
#P message 166 42 28 196617 open;
#P toggle 100 43 15 0;
#P newex 100 67 49 196617 qmetro 2;
#P newex 100 97 86 196617 jit.qt.grab 80 60;
#P user panel 240 32 187 94;
#X brgb 190 190 190;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P comment 216 349 100 196617 Convert to B&W;
#P comment 137 157 130 196617 Black and white thresh;
#P window linecount 2;
#P comment 308 517 100 196617 Make list of black and white pixels;
#P window linecount 1;
#P comment 139 215 100 196617 Maximum Z range;
#P user panel 93 145 336 98;
#X brgb 190 190 190;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 88 141 347 106;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 93 33 140 93;
#X brgb 90 240 100;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 94 32 140 93;
#X brgb 90 240 100;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P user panel 87 26 347 106;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P window linecount 0;
#P comment 289 188 100 196617;
#P user panel 87 255 152 38;
#X brgb 101 99 97;
#X frgb 0 0 0;
#X border 0;
#X rounded 20;
#X shadow 0;
#X done;
#P connect 72 0 55 0;
#P connect 71 0 72 0;
#P connect 64 0 80 0;
#P hidden connect 22 0 71 0;
#P hidden fasten 21 0 36 0 258 89 72 89;
#P hidden fasten 13 0 36 0 105 91 72 91;
#P connect 70 0 35 0;
#P hidden fasten 51 0 35 0 161 322 86 322;
#P hidden fasten 46 0 35 0 102 322 86 322;
#P connect 82 0 37 0;
#P fasten 36 0 37 0 72 759 92 759;
#P fasten 36 1 37 0 112 759 92 759;
#P connect 55 0 37 0;
#P connect 14 0 13 0;
#P hidden fasten 16 0 12 0 202 89 105 89;
#P hidden fasten 15 0 12 0 171 89 105 89;
#P connect 13 0 12 0;
#P hidden fasten 33 0 31 0 580 137 105 137;
#P connect 69 0 59 0;
#P connect 59 0 63 0;
#P connect 63 0 64 0;
#P connect 64 0 65 0;
#P connect 65 0 70 0;
#P connect 77 0 70 0;
#P connect 66 0 69 0;
#P hidden connect 12 0 30 0;
#P hidden fasten 17 0 30 0 258 120 113 120;
#P connect 30 0 26 0;
#P connect 26 0 42 0;
#P connect 42 0 52 0;
#P connect 70 1 35 1;
#P connect 52 0 67 0;
#P connect 67 0 66 0;
#P fasten 64 1 65 1 131 606 126 606;
#P connect 66 0 68 0;
#P connect 81 0 65 2;
#P connect 68 0 69 1;
#P connect 62 0 59 1;
#P hidden connect 12 1 45 0;
#P hidden fasten 29 0 26 1 105 175 206 175;
#P connect 57 0 60 0;
#P hidden fasten 12 0 45 1 105 120 226 120 226 62 211 62;
#P connect 60 0 62 0;
#P fasten 75 0 77 1 191 609 229 609;
#P connect 75 0 76 0;
#P connect 56 0 61 0;
#P connect 61 0 62 1;
#P connect 22 0 21 0;
#P fasten 20 0 17 0 311 89 258 89;
#P fasten 18 0 17 0 342 89 258 89;
#P fasten 19 0 17 0 376 89 258 89;
#P connect 21 0 17 0;
#P fasten 76 0 77 2 244 608 267 608;
#P connect 59 0 79 0;
#P connect 79 0 78 0;
#P connect 78 0 81 0;
#P hidden fasten 50 0 38 0 414 770 319 770;
#P hidden connect 40 0 39 0;
#P fasten 47 0 48 0 354 766 354 751;
#P hidden connect 41 0 40 0;
#P hidden fasten 26 0 40 1 113 366 330 366 330 149 383 149;
#P hidden fasten 48 0 49 0 360 771 397 771;
#P fasten 49 0 50 0 408 764 408 749;
#P fasten 54 0 57 0 573 715 517 715;
#P connect 37 1 54 0;
#P hidden connect 32 0 33 0;
#P fasten 54 1 56 0 639 715 580 715;
#P window clipboard copycount 83;

#72179

You must be logged in to reply to this topic.