Forums > Jitter

videoplane distortion on videoplane at 90° Z rotation

February 12, 2008 | 1:39 am

howdy, its me again with another dum question …..

how come the videoplane is distorted to fit the window on a 90 degrees rotation on the Z axis ?
because of transform_reset 2 ?
how can i avoid this ?
any thoughts , advice much appreciated :)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 35 123 196 196617 jit.gl.render zzz @erase_color 0. 0. 0. 1.;
#P newex 35 96 133 196617 t b b erase;
#P newex 35 70 51 196617 qmetro 2;
#P message 337 207 14 196617 2;
#P message 324 207 14 196617 1;
#P message 311 207 14 196617 0;
#P message 310 229 101 196617 transform_reset $1;
#P message 294 305 70 196617 size 640 480;
#P message 551 196 20 196617 90;
#P message 534 196 14 196617 0;
#P message 223 305 70 196617 size 320 240;
#P flonum 551 228 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 452 250 109 196617 pak rotatexyz 0. 0. 0.;
#P message 224 163 83 196617 read dishes.mov;
#P newex 223 325 76 196617 jit.window zzz;
#P newex 224 184 63 196617 jit.qt.movie;
#P newex 224 273 337 196617 jit.gl.videoplane zzz @automatic 0 @blend_enable 1 @transform_reset 2;
#P newex 96 166 30 196617 t b b;
#P toggle 35 48 15 0;
#P window linecount 5;
#P comment 591 183 100 196617 why are the proportions of the videoplane changed when rotated in Z axis ?;
#P fasten 12 0 5 0 299 323 228 323;
#P fasten 9 0 5 0 228 323 228 323;
#P connect 4 0 3 0;
#P fasten 7 0 3 0 457 270 229 270;
#P connect 2 0 3 0;
#P connect 13 0 3 0;
#P fasten 18 2 19 0 162 118 40 118;
#P connect 18 0 19 0;
#P connect 18 1 2 0;
#P connect 1 0 17 0;
#P connect 17 0 18 0;
#P connect 16 0 13 0;
#P connect 15 0 13 0;
#P connect 14 0 13 0;
#P connect 11 0 8 0;
#P connect 10 0 8 0;
#P connect 2 1 4 0;
#P connect 8 0 7 3;
#P connect 6 0 4 0;
#P window clipboard copycount 20;



Dan
February 12, 2008 | 4:15 am

Because that’s what transform_reset 2 does — it stretches the
videoplane to fit the window. Not sure what you’re after, but you
might try using a [jit.gl.slab @file td.rota.jxs] to rotate the video
before sending it to the videoplane @transform_reset 2. hope that
helps!


February 12, 2008 | 9:25 am

thanks Dan , ill try the td.rota slab trick.
i still wonder if there isn t an easier way to do this (?)
what i am after is actually what is showed in the attached patch :

i am working on a project where i need to have the movies mapped on a videoplane keep their original pixel dimension and aspect ratio no matter what the destination dimensions are. so one pixel on screen = 1 pixel in world.
i then want to be able to manipulate that videoplane without it being distorted.

how can i force it not to be distorted ?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 677 325 198 196617 3 -rotate it in Z plane;
#P comment 677 312 198 196617 2 – pick a movie;
#P message 320 170 83 196617 read dvkite.mov;
#P message 444 626 76 196617 size 1440 900;
#P message 373 626 70 196617 size 500 500;
#P newex 534 402 27 196617 / 1.;
#P newex 456 429 87 196617 pak scale 0. 0. 1.;
#P newex 558 581 63 196617 unpack 0 0;
#P newex 558 559 78 196617 route dest_dim;
#P newex 481 357 63 196617 unpack 0 0;
#P newex 481 402 27 196617 / 1.;
#P newex 369 266 27 196617 t l b;
#P message 386 357 65 196617 getdest_dim;
#P newex 284 236 80 196617 t getmovie_dim;
#P newex 284 214 180 196617 route read movie_dim;
#P newex 42 130 196 196617 jit.gl.render zzz @erase_color 0. 0. 0. 1.;
#P newex 42 103 133 196617 t b b erase;
#P newex 42 77 51 196617 qmetro 2;
#P message 107 461 14 196617 2;
#P message 94 461 14 196617 1;
#P message 81 461 14 196617 0;
#P message 80 483 101 196617 transform_reset $1;
#P message 302 626 70 196617 size 640 480;
#P message 558 459 20 196617 90;
#B color 5;
#P message 541 459 14 196617 0;
#P message 231 626 70 196617 size 320 240;
#P flonum 558 491 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 459 513 109 196617 pak rotatexyz 0. 0. 0.;
#P message 231 170 83 196617 read dishes.mov;
#P newex 231 646 147 196617 jit.window zzz @size 500 500;
#P newex 231 191 107 196617 jit.qt.movie @adapt 1;
#P newex 231 536 337 196617 jit.gl.videoplane zzz @automatic 0 @blend_enable 1 @transform_reset 2;
#P newex 103 173 30 196617 t b b;
#P toggle 42 55 15 0;
#P comment 231 611 251 196617 reload the movie each time you change the movie size;
#P window linecount 2;
#P comment 251 684 259 196617 a 500×500 does not distort the videoplane when rotated on Z axis , whereas a 640X480 window does …;
#P comment 191 587 100 196617 try different window settings :;
#P window linecount 1;
#P comment 677 299 198 196617 1 – pick a window size;
#P connect 4 0 20 0;
#P connect 20 0 21 0;
#P connect 21 0 22 0;
#P fasten 21 2 22 0 169 125 47 125;
#P connect 17 0 16 0;
#P connect 18 0 16 0;
#P connect 19 0 16 0;
#P connect 21 1 5 0;
#P fasten 35 0 7 0 325 188 236 188;
#P connect 5 1 7 0;
#P connect 9 0 7 0;
#P fasten 24 0 7 0 289 261 416 261 416 188 244 188 236 188;
#P lcolor 1;
#P connect 31 0 6 0;
#P connect 7 0 6 0;
#P connect 25 0 6 0;
#P connect 16 0 6 0;
#P connect 5 0 6 0;
#P fasten 10 0 6 0 464 533 236 533;
#P fasten 12 0 8 0 236 644 236 644;
#P fasten 15 0 8 0 307 644 236 644;
#P connect 33 0 8 0;
#P connect 34 0 8 0;
#P fasten 7 1 23 0 333 211 289 211;
#P connect 23 0 24 0;
#P connect 23 1 26 0;
#P connect 26 1 25 0;
#P fasten 26 0 28 0 374 288 486 288;
#P connect 28 0 27 0;
#P connect 27 0 31 1;
#P fasten 30 0 27 1 563 608 664 608 664 392 503 392;
#P connect 32 0 31 2;
#P connect 28 1 32 0;
#P fasten 30 1 32 1 616 603 653 603 653 399 556 399;
#P connect 13 0 11 0;
#P connect 14 0 11 0;
#P connect 11 0 10 3;
#P connect 6 1 29 0;
#P connect 29 0 30 0;
#P window clipboard copycount 38;

Quote: Dan wrote on Tue, 12 February 2008 05:15
—————————————————-
> Because that’s what transform_reset 2 does — it stretches the
> videoplane to fit the window. Not sure what you’re after, but you
> might try using a [jit.gl.slab @file td.rota.jxs] to rotate the video
> before sending it to the videoplane @transform_reset 2. hope that
> helps!
>
>
>
—————————————————-


June 8, 2010 | 12:17 am

hey list,

quite an old thread, but still a good question.
is there an easy way to rotate a videoplane with reset 2
without distort it.

the only way i found out was store the movie dimension ratio
and use reset 1.

but thats not very comfortable, if you want to scale and rotate
afterwards, or if you load movies with different dimensions.

perhaps there is an elegant solution for this problem.

a.


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