Forums > Jitter

Help: videoplane or matrix for composite?

November 5, 2007 | 11:02 pm

Hello,

I am not very experienced working with jitter yet, so this may be an easy question to answer :)

I need to have 3 or 4 movies in one window. I want to scale, move and crop each of it seperataly.
For croping and compositing 3 movies, I tried with jit.matrix (like in tutorial 16).
For the moving around and scaling part, I tried jit.gl.videoplane.
My question: can I crop (define start and end dimension, without squeezing the picture however) in jit.gl.videoplane also? And: how do I get 3 or 4 movies together in one window using videoplane (is there something like "layer"?)? Whats the best way to achieve optimal performance?

Thanks for help!


November 6, 2007 | 4:52 pm

If i were you i would use 1 jit.gl.videoplane for each movie.
If you look in the help file for jit.gl.videoplane, there are controls for scaling and offsetting your texture. You can use position and scale commands to the jit.gl.videoplane to move it around in 3d space.

If you want to crop, you could control multiple parameters at the same time. Another way would be to crop your texture, using subdim, for example.

Here’s an example, it’s basically a stripped down version of videoplane with only the controls you want. The slider changes a few values to emulate your ‘crop’. Good luck!

#P window setfont "Sans Serif" 9.;
#P number 197 437 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 160 437 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 123 464 85 196617 pak offset 0 0;
#P number 95 437 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 58 437 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 464 85 196617 pak dim 0 0;
#P newex 257 497 195 196617 jit.submatrix @offset 0 0 @dim 320 240;
#B color 5;
#P newex 123 217 31 196617 !/ 1.;
#P newex 122 196 30 196617 !- 1.;
#P newex 122 173 93 196617 scale 0. 127. 0. 1.;
#P comment 377 427 62 196617 right movie;
#P slider 122 34 15 128 0 1;
#P newex 685 78 34 196617 * -1.;
#P newex 686 107 63 196617 loadmess 0.;
#P newex 686 51 63 196617 loadmess 1.;
#P message 364 594 79 196617 tex_scale_y $1;
#P flonum 364 571 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 277 594 79 196617 tex_scale_x $1;
#P flonum 277 571 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 364 548 83 196617 tex_offset_y $1;
#P flonum 364 528 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 277 549 83 196617 tex_offset_x $1;
#P flonum 277 529 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 20.;
#P message 257 428 52 196628 read;
#P window setfont "Sans Serif" 9.;
#P newex 257 470 184 196617 jit.qt.movie 320 240 @vol 0. @rate 1.;
#B color 5;
#P flonum 558 522 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 520 522 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 480 522 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 455 549 85 196617 pak scale 1. 1. 1.;
#P flonum 577 570 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 539 570 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 499 570 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 257 640 336 196617 jit.gl.videoplane foo @depth_enable 1 @blend_enable 1 @color 1. 1. 1. 1.;
#B color 5;
#P newex 471 594 95 196617 pak position 0. 0. 0.;
#P user panel 252 421 386 240;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P message 364 319 79 196617 tex_scale_y $1;
#P flonum 364 296 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 277 319 79 196617 tex_scale_x $1;
#P flonum 277 296 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 364 273 83 196617 tex_offset_y $1;
#P flonum 364 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 277 274 83 196617 tex_offset_x $1;
#P flonum 277 254 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 20.;
#P message 257 184 52 196628 read;
#P window setfont "Sans Serif" 9.;
#P newex 257 226 184 196617 jit.qt.movie 320 240 @vol 0. @rate 1.;
#B color 5;
#P flonum 558 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 520 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 480 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 455 274 85 196617 pak scale 1. 1. 1.;
#P newex 310 147 145 196617 jit.window foo @depthbuffer 1;
#P flonum 577 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 539 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 499 295 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 311 33 27 0;
#P newex 311 78 57 196617 qmetro 20;
#P newex 311 100 58 196617 t b erase b;
#P newex 257 365 336 196617 jit.gl.videoplane foo @depth_enable 1 @blend_enable 1 @color 1. 1. 1. 1.;
#B color 5;
#P newex 311 126 153 196617 jit.gl.render foo @camera 0 0 3;
#P newex 471 319 95 196617 pak position 0. 0. 0.;
#P comment 378 182 56 196617 left movie;
#P user panel 252 177 386 240;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 56 0 55 1;
#P connect 57 0 55 2;
#P connect 49 0 51 0;
#P connect 51 0 52 0;
#P connect 52 0 53 0;
#P connect 59 0 58 1;
#P connect 60 0 58 2;
#P connect 5 2 16 0;
#P fasten 17 0 16 0 262 219 262 219;
#P fasten 16 0 4 0 262 353 262 353;
#P fasten 2 0 4 0 476 357 262 357;
#P fasten 12 0 4 0 460 357 262 357;
#P fasten 19 0 4 0 282 293 262 293;
#P fasten 21 0 4 0 369 293 262 293;
#P fasten 23 0 4 0 282 349 262 349;
#P fasten 25 0 4 0 369 349 262 349;
#P connect 5 2 36 0;
#P fasten 37 0 36 0 262 463 262 463;
#P connect 36 0 54 0;
#P connect 58 0 54 0;
#P connect 55 0 54 0;
#P connect 54 0 28 0;
#P fasten 45 0 28 0 369 624 262 624;
#P fasten 43 0 28 0 282 624 262 624;
#P fasten 41 0 28 0 369 568 262 568;
#P fasten 39 0 28 0 282 568 262 568;
#P fasten 32 0 28 0 460 632 262 632;
#P fasten 27 0 28 0 476 632 262 632;
#P hidden connect 47 0 18 0;
#P lcolor 1;
#P connect 18 0 19 0;
#P hidden connect 46 0 22 0;
#P lcolor 1;
#P connect 53 0 22 0;
#P lcolor 15;
#P connect 22 0 23 0;
#P hidden connect 47 0 38 0;
#P lcolor 1;
#P connect 38 0 39 0;
#P hidden connect 46 0 42 0;
#P lcolor 1;
#P connect 42 0 43 0;
#P connect 7 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 3 0;
#P fasten 5 1 3 0 340 122 316 122;
#P hidden connect 47 0 20 0;
#P lcolor 1;
#P connect 20 0 21 0;
#P hidden connect 46 0 24 0;
#P lcolor 1;
#P connect 53 0 24 0;
#P lcolor 15;
#P connect 24 0 25 0;
#P hidden connect 47 0 40 0;
#P lcolor 1;
#P connect 40 0 41 0;
#P hidden connect 46 0 44 0;
#P lcolor 1;
#P connect 44 0 45 0;
#P hidden connect 46 0 13 0;
#P lcolor 1;
#P connect 52 0 13 0;
#P lcolor 15;
#P connect 13 0 12 1;
#P hidden connect 46 0 33 0;
#P lcolor 1;
#P connect 33 0 32 1;
#P hidden connect 47 0 8 0;
#P lcolor 1;
#P hidden connect 48 0 8 0;
#P lcolor 1;
#P connect 8 0 2 1;
#P hidden connect 46 0 29 0;
#P lcolor 1;
#P connect 29 0 27 1;
#P fasten 14 0 12 2 525 268 510 268;
#P fasten 34 0 32 2 525 543 510 543;
#P hidden connect 46 0 14 0;
#P lcolor 1;
#P connect 52 0 14 0;
#P lcolor 15;
#P hidden connect 46 0 34 0;
#P lcolor 1;
#P fasten 9 0 2 2 544 314 532 314;
#P fasten 30 0 27 2 544 589 532 589;
#P fasten 15 0 12 3 563 268 535 268;
#P fasten 35 0 32 3 563 543 535 543;
#P hidden connect 47 0 9 0;
#P lcolor 1;
#P hidden connect 47 0 30 0;
#P lcolor 1;
#P fasten 10 0 2 3 582 314 560 314;
#P fasten 31 0 27 3 582 589 560 589;
#P hidden connect 46 0 15 0;
#P lcolor 1;
#P hidden connect 46 0 35 0;
#P lcolor 1;
#P hidden connect 47 0 10 0;
#P lcolor 1;
#P hidden connect 47 0 31 0;
#P lcolor 1;
#P hidden connect 46 0 48 0;
#P lcolor 1;
#P window clipboard copycount 61;


November 7, 2007 | 7:18 am

Thanx! That helps a lot.


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