Hallo!
I have the following (basic) GEM problem (and some ascii-art ;) :
I have 2 movies running with pix_film which are rendered on rectangles with the same size over the whole screen and I want to see only a part of each movie (see illustration):
| | | | | | | |-------| | | | partA | | | | | | | |-------| |
| |--------| | | | partB | | | | | | | |--------| | | | | | | |
| |--------| | | | partB | | | |(movieB)| | | |-------| |--------| | | | partA | | | |(movieA| | | |-------| |
So I tried to lay black rectangles over the movies and let free partA,partB so that one can only see these parts. But this does not work for multiple movies, because then I only see the movie with the highest gemhead priority (and also with alpha blending it was not possible) ...
So my question: is this possible without additional pix_* commands ? (e.g. texturing only a part of the movie onto a rectangle ... ?) If yes has someone an idea how ?
Thanks for any hint, LG Georg
PS: if this is too confusing I can send an example patch ;)
On 22 Jan 2008, at 11:03 PM, Georg Holzmann wrote:
Hallo!
I have the following (basic) GEM problem (and some ascii-art ;) :
I have 2 movies running with pix_film which are rendered on rectangles with the same size over the whole screen and I want to see only a part of each movie (see illustration):
from movie A:
| | | | | | | |-------| | | | partA | | | | | | | |-------| |
from movie B:
| |--------| | | | partB | | | | | | | |--------| | | | | | | |
together:
| |--------| | | | partB | | | |(movieB)| | | |-------| |--------| | | | partA | | | |(movieA| | | |-------| |
So I tried to lay black rectangles over the movies and let free partA,partB so that one can only see these parts. But this does not
work for multiple movies, because then I only see the movie with the
highest gemhead priority (and also with alpha blending it was not
possible) ...So my question: is this possible without additional pix_* commands ? (e.g. texturing only a part of the movie onto a rectangle ... ?) If yes has someone an idea how ?
Thanks for any hint, LG Georg
PS: if this is too confusing I can send an example patch ;)
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
a somewhat clumsy workaround would be to make a transparent rectangle
the size of part A, in front of the others in space, then movie B
with the black masks behind that, then movie A behind that:
set your gemwin to 'orthagonal'
set the render order of the oblects:
movie A first part A second movie B with masks etc next
but there is probably also a way to render part of the image, I'd
like to know also
simon
IOhannes m zmoelnig wrote:
Georg Holzmann wrote:
Hallo!
why can't you use subtexture rendering?
How can I do that ?
[pix_coordinate]
to clarify: what is wrong with using 2 small rectangles where the selected section is textured to? if i understand your original email correctly, you are trying to avoid this.
anyhow, here is how i would do that...
dfmasr IOhannes
#N canvas 1414 71 953 554 10; #X obj 72 91 gemwin; #X msg 70 60 create , 1; #X obj 124 218 gemhead; #X obj 125 254 pix_film; #X obj 123 274 pix_texture; #X obj 105 329 pix_coordinate; #X obj 191 254 t f; #X obj 295 329 t b f; #X obj 335 329 t b f; #X obj 385 329 t b f; #X obj 295 307 / 100; #X obj 338 306 / 100; #X obj 383 305 / 100; #X obj 248 307 / 100; #X msg 295 373 $1 $2 $3 $2 $3 $4 $1 $4; #X floatatom 248 283 5 0 100 0 - - -; #X floatatom 298 283 5 0 100 0 - - -; #X floatatom 338 283 5 0 100 0 - - -; #X floatatom 378 283 5 0 100 0 - - -; #X msg 192 215 open data/anim-1.mov , auto 1; #X obj 105 381 translateXYZ -2 -2 0; #X obj 295 349 pack 0.25 0.25 0.5 0.5; #X obj 568 223 gemhead; #X obj 569 259 pix_film; #X obj 567 279 pix_texture; #X obj 549 334 pix_coordinate; #X obj 635 259 t f; #X obj 739 334 t b f; #X obj 779 334 t b f; #X obj 829 334 t b f; #X obj 739 312 / 100; #X obj 782 311 / 100; #X obj 827 310 / 100; #X obj 692 312 / 100; #X msg 739 378 $1 $2 $3 $2 $3 $4 $1 $4; #X floatatom 692 288 5 0 100 0 - - -; #X floatatom 742 288 5 0 100 0 - - -; #X floatatom 782 288 5 0 100 0 - - -; #X floatatom 822 288 5 0 100 0 - - -; #X msg 636 220 open data/anim-1.mov , auto 1; #X obj 549 386 translateXYZ 2 2 0; #X obj 105 414 square 2; #X obj 549 419 square 2; #X obj 739 354 pack 0.5 0.5 0.75 0.75; #X msg 742 420 0 0 1 0 1 1 0 1; #X msg 306 416 0 0 1 0 1 1 0 1; #X msg 451 209 0; #X msg 495 477 bang; #X msg 488 327 bang; #X obj 490 300 loadbang; #X text 455 186 sync the films; #X msg 671 257 0; #X msg 233 258 0; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 2 6 0; #X connect 4 0 5 0; #X connect 5 0 20 0; #X connect 6 0 3 1; #X connect 7 0 21 0; #X connect 7 1 21 1; #X connect 8 0 21 0; #X connect 8 1 21 2; #X connect 9 0 21 0; #X connect 9 1 21 3; #X connect 10 0 7 0; #X connect 11 0 8 0; #X connect 12 0 9 0; #X connect 13 0 21 0; #X connect 14 0 5 1; #X connect 15 0 13 0; #X connect 16 0 10 0; #X connect 17 0 11 0; #X connect 18 0 12 0; #X connect 19 0 3 0; #X connect 20 0 41 0; #X connect 21 0 14 0; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 23 2 26 0; #X connect 24 0 25 0; #X connect 25 0 40 0; #X connect 26 0 23 1; #X connect 27 0 43 0; #X connect 27 1 43 1; #X connect 28 0 43 0; #X connect 28 1 43 2; #X connect 29 0 43 0; #X connect 29 1 43 3; #X connect 30 0 27 0; #X connect 31 0 28 0; #X connect 32 0 29 0; #X connect 33 0 43 0; #X connect 34 0 25 1; #X connect 35 0 33 0; #X connect 36 0 30 0; #X connect 37 0 31 0; #X connect 38 0 32 0; #X connect 39 0 23 0; #X connect 40 0 42 0; #X connect 43 0 34 0; #X connect 44 0 25 1; #X connect 45 0 5 1; #X connect 46 0 6 0; #X connect 46 0 26 0; #X connect 47 0 45 0; #X connect 47 0 44 0; #X connect 48 0 21 0; #X connect 48 0 43 0; #X connect 49 0 48 0; #X connect 51 0 26 0; #X connect 52 0 6 0;
Hallo!
Thanks Claude and IOhannes for the examples !
to clarify: what is wrong with using 2 small rectangles where the selected section is textured to? if i understand your original email correctly, you are trying to avoid this.
No, it is what I want I simply did not know that this is possible with [pix_coordinate].
However, is there somewhere (opengl-) documentation what exactly the parameters of [pix_coordinate] are ? (which number correspondes to which effect?) Or for which word I should to search to find this in the opengl docu ...
Thanks, LG Georg
Georg Holzmann wrote:
Hallo!
Thanks Claude and IOhannes for the examples !
to clarify: what is wrong with using 2 small rectangles where the selected section is textured to? if i understand your original email correctly, you are trying to avoid this.
No, it is what I want I simply did not know that this is possible with [pix_coordinate].
ok, i see.
However, is there somewhere (opengl-) documentation what exactly the parameters of [pix_coordinate] are ? (which number correspondes to which effect?)
i thought it is covered in the help-patch for [pix_coordinate]
of course, you have to know that there is such an object and that it might approximately do what you want...
Or for which word I should to search to find this in the opengl docu ...
keywords are "texture coordinates"
fgma,dsr. IOhannes
On 23 Jan 2008, at 1:59 AM, IOhannes m zmoelnig wrote:
How can I do that ?
[pix_coordinate]
that works, it was what I was looking for too, and it's probably more
efficient - but it does need some fiddling if you want to keep the
various movies lined up full frame and move the exposed part around.
Also it only works for rectangles.
But it will be just what I need for fitting parts of an image onto
walls on a stage!
thanks.
simon
Georg Holzmann wrote:
So my question: is this possible without additional pix_* commands ? (e.g. texturing only a part of the movie onto a rectangle ... ?) If yes has someone an idea how ?
You can use awkward maths to change the texture coordinates of the rectangle, to display only part of the texture. The tricky part of the maths is due to these things:
nearest power of 2 (at least on my gfx card).
could get to work on my gfx card...).
height-of-gemwin = 4 or so.
See here (images too big for list):
http://claudiusmaximus.goto10.org/files/temp/viewport-example.tar.gz
Hope this helps,