Forums > Jitter

Newb Question (manipulating a movie using mouse movement data)

February 4, 2008 | 5:39 am

I’ve just started working with Jitter a couple of weeks ago and hope to use it for an upcoming project. I am trying to create an interactive video piece in which one layer of video can be "erased" to reveal another layer of video. Right now I’m just trying to develop using a USB track pad as the input.

Anyway, I am having some difficulty trying to figure out exactly how to get the mouse data (in this case the track pad) to modify the video clip. As far as I can tell its a matter of getting the x and y coordinates to be associated with a change in alpha (resulting in an "erasing" effect). However, I can’t quite seem to figure out how to translate the mouse tracking data into a modification of the layer 0 (alpha layer) cell data.

I’ve browsed through the tutorials (having completed the first ten or so already) and while there have been some promising leads, I just can’t seem to get all the pieces to fit together. Ideally I’d love to come up with something that functions like the LCD object except that it modifies and existing image/movie (ie manipulating the movie by "drawing" on top of it directly.

Any help that you guys can offer would be greatly appreciated.

Thanks!


February 4, 2008 | 6:06 am

you can use jit.lcd to draw out a new alpha channel, and then ‘pack’
in the new alpha channel with jit.unpack and jit.pack. Just one off of
the cuff idea:

add some blurring in there, or whatnot, or use lcd shapes, etc etc :)

note if you want to go with larger movies or higher performance stuff,
take a look at opengl with jitter, but this should get you going. :)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 484 89 48 196617 loadbang;
#P newex 87 292 66 196617 jit.unpack 4;
#P newex 87 268 81 196617 jit.matrix alpha;
#P number 523 110 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 520 131 71 196617 pensize $1 $1;
#P message 319 142 30 196617 read;
#P newex 162 348 53 196617 jit.pack 4;
#P newex 162 223 66 196617 jit.unpack 4;
#N vpatcher 40 104 640 504;
#P toggle 50 214 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 50 232 47 196617 gate 1 1;
#P newex 187 221 50 196617 gate 2 2;
#P message 209 248 50 196617 set lineto;
#P message 126 249 58 196617 set moveto;
#P newex 124 143 29 196617 t i b;
#P newex 126 170 27 196617 int;
#P newex 50 187 47 196617 pack 0 0;
#P comment 65 124 28 196617 x , y;
#P number 124 102 16 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 87 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 50 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 50 76 67 196617 unpack 0 0 0;
#P newex 50 50 110 196617 route mouse mouseidle;
#P comment 134 124 169 196617 button , cmd , shift , caps , opt ,
ctrl;
#P newex 126 191 40 196617 sel 0 1;
#P user ubumenu 187 194 82 196617 0 1 1 0;
#X add no_mouse;
#X add mouse_moves;
#X add mouse_draws;
#X prefix_set 0 0 0;
#P inlet 50 30 15 0;
#P outlet 48 338 15 0;
#P connect 17 0 0 0;
#P connect 15 0 0 0;
#P connect 14 0 0 0;
#P connect 1 0 5 0;
#P connect 5 0 6 0;
#P fasten 5 1 6 0 105 71 55 71;
#P connect 6 0 7 0;
#P connect 7 0 11 0;
#P fasten 2 0 18 0 192 211 55 211;
#P connect 18 0 17 0;
#P fasten 6 1 8 0 83 97 92 97;
#P connect 8 0 11 1;
#P fasten 11 0 17 1 55 211 92 211;
#P fasten 6 2 9 0 111 97 129 97;
#P connect 9 0 13 0;
#P connect 13 1 12 0;
#P connect 12 0 3 0;
#P fasten 16 0 14 0 192 244 131 244;
#P connect 3 0 14 0;
#P connect 13 0 12 1;
#P fasten 2 0 16 0 192 214 192 214;
#P fasten 16 1 15 0 232 244 214 244;
#P fasten 3 1 16 1 146 218 232 218;
#P pop;
#P newobj 567 213 121 196617 p stolen from jit.lcd help;
#P message 484 131 33 196617 clear;
#P newex 464 259 81 196617 jit.matrix alpha;
#P message 183 142 30 196617 read;
#P newex 297 179 105 196617 jit.qt.movie 320 240;
#P window linecount 2;
#P comment 347 217 100 196617 2nd layer to be revealed;
#P toggle 162 36 15 0;
#P window linecount 1;
#P newex 162 75 67 196617 metro 33.33;
#P newex 237 429 122 196617 jit.window @idlemouse 1;
#P newex 567 237 79 196617 prepend moveto;
#P newex 464 158 111 196617 jit.lcd 4 char 320 240;
#P newex 237 404 70 196617 jit.alphablend;
#P newex 162 179 105 196617 jit.qt.movie 320 240;
#P comment 179 206 100 196617 1st layer;
#P connect 6 0 19 0;
#P connect 6 0 1 0;
#P connect 6 0 9 0;
#P connect 6 0 3 0;
#P connect 21 0 12 0;
#P fasten 4 0 3 0 572 305 720 305 720 57 469 57;
#P fasten 5 1 13 0 354 459 546 459 546 207 572 207;
#P connect 2 0 5 0;
#P connect 3 0 11 0;
#P connect 20 1 15 0;
#P connect 19 0 20 0;
#P connect 17 0 3 0;
#P connect 12 0 3 0;
#P connect 18 0 17 0;
#P connect 16 0 9 0;
#P fasten 15 0 2 0 167 384 242 384;
#P connect 9 0 2 1;
#P connect 1 0 14 0;
#P connect 14 3 15 3;
#P connect 14 2 15 2;
#P connect 14 1 15 1;
#P connect 13 0 4 0;
#P connect 10 0 1 0;
#P connect 7 0 6 0;
#P window clipboard copycount 22;

On Feb 4, 2008, at 12:39 AM, Andrew Goodman wrote:

>
> I’ve just started working with Jitter a couple of weeks ago and hope
> to use it for an upcoming project. I am trying to create an
> interactive video piece in which one layer of video can be "erased"
> to reveal another layer of video. Right now I’m just trying to
> develop using a USB track pad as the input.
>
> Anyway, I am having some difficulty trying to figure out exactly how
> to get the mouse data (in this case the track pad) to modify the
> video clip. As far as I can tell its a matter of getting the x and y
> coordinates to be associated with a change in alpha (resulting in an
> "erasing" effect). However, I can’t quite seem to figure out how to
> translate the mouse tracking data into a modification of the layer 0
> (alpha layer) cell data.
>
> I’ve browsed through the tutorials (having completed the first ten
> or so already) and while there have been some promising leads, I
> just can’t seem to get all the pieces to fit together. Ideally I’d
> love to come up with something that functions like the LCD object
> except that it modifies and existing image/movie (ie manipulating
> the movie by "drawing" on top of it directly.
>
> Any help that you guys can offer would be greatly appreciated.
>
> Thanks!


August 20, 2010 | 3:59 am

Hello
I’m very interested of drawing alpha channels so I can see de video behind.
I’m using the patch that was shared in this post, but i can not get it work. I "draw" in the windows but nothing happens.

Is there something that i need to know besides this post so I can get the patch work?

thanks


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