Forums > Jitter

proportion issue while rendering to matrix

November 14, 2007 | 1:46 pm

Hi there, i have issues keeping proportions of my image while changing dimensions when rendering to a matrix with the jit.gl.sketch/glread pixels method.
could anybody tell me what i am missing in the following patch :
thanks in advance

max v2;
#N vpatcher 147 407 1077 1046;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 56 206 265 196617 jit.gl.videoplane bob @scale 1.333 1. 1. @blend_enable 1;
#P newex 685 243 147 196617 jit.window bob @size 640 480;
#P newex 395 53 48 196617 loadbang;
#P toggle 356 53 15 0;
#P newex 356 74 29 196617 gate;
#P button 395 74 15 0;
#P newex 356 97 30 196617 t b b;
#P message 395 97 115 196617 reset , glreadpixels bibi;
#P newex 115 123 83 196617 jit.gl.render bob;
#P newex 38 79 66 196617 t b b b erase;
#P message 76 153 83 196617 read dishes.mov;
#P flonum 79 37 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 38 37 15 0;
#P newex 38 58 57 196617 qmetro 33;
#P newex 56 185 144 196617 jit.qt.movie 320 240;
#P user jit.fpsgui 294 278 60 196617 3;
#P newex 685 189 66 196617 prepend size;
#P newex 569 165 40 196617 t l l l;
#P newex 617 189 64 196617 prepend dim;
#N vpatcher 40 104 640 504;
#P outlet 51 220 15 0;
#P window setfont "Sans Serif" 9.;
#P message 184 179 186 196617 srcdimstart 0 479 , srcdimend 319 0;
#P newex 184 159 62 196617 prepend set;
#P newex 51 132 27 196617 t l b;
#P message 68 155 65 196617 usesrcdim 1;
#P newex 50 50 69 196617 vexpr $i1 -1;
#P newex 51 70 40 196617 unpack;
#P newex 51 110 218 196617 sprintf srcdimstart 0 %ld \, srcdimend %ld 0;
#P inlet 50 30 15 0;
#P comment 380 169 100 196617 shouldnt this work ?;
#P connect 1 0 4 0;
#P connect 4 0 3 0;
#P connect 3 1 2 0;
#P connect 2 0 6 0;
#P connect 6 0 9 0;
#P connect 5 0 9 0;
#P connect 6 1 5 0;
#P connect 2 0 7 0;
#P connect 7 0 8 0;
#P fasten 3 0 2 1 56 98 264 98;
#P pop;
#P newobj 569 189 42 196617 p adapt;
#P user ubumenu 525 141 100 196617 0 1 1 0;
#X add 320 240;
#X add 640 480;
#X add 720 540;
#X add 1024 768;
#X prefix_set 0 0 0;
#P user jit.pwindow 355 277 322 242 0 0 0 0 0 0;
#P newex 356 244 303 196617 jit.matrix @usesrcdim 1 @srcdimstart 0 239 @srcdimend 319 0;
#P newex 376 141 146 196617 jit.gl.sketch bob @automatic 0;
#P newex 356 215 148 196617 jit.matrix bibi 4 char 320 240;
#P window linecount 4;
#P comment 628 131 100 196617 only 320 240 dim keeps the right proportions , what am i doing wrong;
#P connect 13 0 12 0;
#P connect 12 0 16 0;
#P fasten 16 1 11 0 61 131 61 131;
#P fasten 15 0 11 0 81 173 61 173;
#P connect 11 0 25 0;
#P connect 14 0 12 1;
#P connect 16 3 17 0;
#P connect 16 2 17 0;
#P fasten 3 0 10 0 361 265 299 265;
#P connect 22 0 21 0;
#P connect 21 0 19 0;
#P fasten 7 0 1 0 622 210 361 210;
#P connect 19 0 1 0;
#P connect 1 0 3 0;
#P fasten 6 0 3 0 574 237 361 237;
#P connect 3 0 4 0;
#P fasten 16 0 21 1 43 102 344 102 344 42 380 42;
#P connect 18 0 2 0;
#P connect 19 1 2 0;
#P connect 23 0 20 0;
#P connect 20 0 18 0;
#P connect 5 1 8 0;
#P connect 8 0 6 0;
#P fasten 8 1 7 0 589 185 622 185;
#P fasten 8 2 9 0 604 185 690 185;
#P connect 9 0 24 0;
#P pop;


November 15, 2007 | 3:49 pm

anyone ?
this is probably something stupid i am overseeing so some advice would be greatly appreciated :)
best

Quote: (karrrlo) wrote on Wed, 14 November 2007 14:46
—————————————————-
> Hi there, i have issues keeping proportions of my image while changing dimensions when rendering to a matrix with the jit.gl.sketch/glread pixels method.
> could anybody tell me what i am missing in the following patch :
> thanks in advance
>
> max v2;
> #N vpatcher 147 407 1077 1046;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 56 206 265 196617 jit.gl.videoplane bob @scale 1.333 1. 1. @blend_enable 1;
> #P newex 685 243 147 196617 jit.window bob @size 640 480;
> #P newex 395 53 48 196617 loadbang;
> #P toggle 356 53 15 0;
> #P newex 356 74 29 196617 gate;
> #P button 395 74 15 0;
> #P newex 356 97 30 196617 t b b;
> #P message 395 97 115 196617 reset , glreadpixels bibi;
> #P newex 115 123 83 196617 jit.gl.render bob;
> #P newex 38 79 66 196617 t b b b erase;
> #P message 76 153 83 196617 read dishes.mov;
> #P flonum 79 37 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 38 37 15 0;
> #P newex 38 58 57 196617 qmetro 33;
> #P newex 56 185 144 196617 jit.qt.movie 320 240;
> #P user jit.fpsgui 294 278 60 196617 3;
> #P newex 685 189 66 196617 prepend size;
> #P newex 569 165 40 196617 t l l l;
> #P newex 617 189 64 196617 prepend dim;
> #N vpatcher 40 104 640 504;
> #P outlet 51 220 15 0;
> #P window setfont "Sans Serif" 9.;
> #P message 184 179 186 196617 srcdimstart 0 479 , srcdimend 319 0;
> #P newex 184 159 62 196617 prepend set;
> #P newex 51 132 27 196617 t l b;
> #P message 68 155 65 196617 usesrcdim 1;
> #P newex 50 50 69 196617 vexpr $i1 -1;
> #P newex 51 70 40 196617 unpack;
> #P newex 51 110 218 196617 sprintf srcdimstart 0 %ld \, srcdimend %ld 0;
> #P inlet 50 30 15 0;
> #P comment 380 169 100 196617 shouldnt this work ?;
> #P connect 1 0 4 0;
> #P connect 4 0 3 0;
> #P connect 3 1 2 0;
> #P connect 2 0 6 0;
> #P connect 6 0 9 0;
> #P connect 5 0 9 0;
> #P connect 6 1 5 0;
> #P connect 2 0 7 0;
> #P connect 7 0 8 0;
> #P fasten 3 0 2 1 56 98 264 98;
> #P pop;
> #P newobj 569 189 42 196617 p adapt;
> #P user ubumenu 525 141 100 196617 0 1 1 0;
> #X add 320 240;
> #X add 640 480;
> #X add 720 540;
> #X add 1024 768;
> #X prefix_set 0 0 0;
> #P user jit.pwindow 355 277 322 242 0 0 0 0 0 0;
> #P newex 356 244 303 196617 jit.matrix @usesrcdim 1 @srcdimstart 0 239 @srcdimend 319 0;
> #P newex 376 141 146 196617 jit.gl.sketch bob @automatic 0;
> #P newex 356 215 148 196617 jit.matrix bibi 4 char 320 240;
> #P window linecount 4;
> #P comment 628 131 100 196617 only 320 240 dim keeps the right proportions , what am i doing wrong;
> #P connect 13 0 12 0;
> #P connect 12 0 16 0;
> #P fasten 16 1 11 0 61 131 61 131;
> #P fasten 15 0 11 0 81 173 61 173;
> #P connect 11 0 25 0;
> #P connect 14 0 12 1;
> #P connect 16 3 17 0;
> #P connect 16 2 17 0;
> #P fasten 3 0 10 0 361 265 299 265;
> #P connect 22 0 21 0;
> #P connect 21 0 19 0;
> #P fasten 7 0 1 0 622 210 361 210;
> #P connect 19 0 1 0;
> #P connect 1 0 3 0;
> #P fasten 6 0 3 0 574 237 361 237;
> #P connect 3 0 4 0;
> #P fasten 16 0 21 1 43 102 344 102 344 42 380 42;
> #P connect 18 0 2 0;
> #P connect 19 1 2 0;
> #P connect 23 0 20 0;
> #P connect 20 0 18 0;
> #P connect 5 1 8 0;
> #P connect 8 0 6 0;
> #P fasten 8 1 7 0 589 185 622 185;
> #P fasten 8 2 9 0 604 185 690 185;
> #P connect 9 0 24 0;
> #P pop;
>
—————————————————-


November 15, 2007 | 4:15 pm

in your adapt-subpatch, you fall into the age old "commas are only
for messageboxes" trap.

hth

/*j

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 56 206 265 196617 jit.gl.videoplane bob @scale 1.333 1. 1.
@blend_enable 1;
#P newex 685 243 147 196617 jit.window bob @size 640 480;
#P newex 395 53 48 196617 loadbang;
#P toggle 356 53 15 0;
#P newex 356 74 29 196617 gate;
#P button 395 74 15 0;
#P newex 356 97 30 196617 t b b;
#P message 395 97 115 196617 reset , glreadpixels bibi;
#P newex 115 123 83 196617 jit.gl.render bob;
#P newex 38 79 66 196617 t b b b erase;
#P message 76 153 83 196617 read dishes.mov;
#P flonum 79 37 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 38 37 15 0;
#P newex 38 58 57 196617 qmetro 33;
#P newex 56 185 144 196617 jit.qt.movie 320 240;
#P user jit.fpsgui 294 278 60 196617 3;
#P newex 685 189 66 196617 prepend size;
#P newex 569 165 40 196617 t l l l;
#P newex 617 189 64 196617 prepend dim;
#N vpatcher 40 104 956 567;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 515 242 304 196617 the comma is onl useful in the message
box: it separates into two messages what’s in it , no other object
knows waht to do whitha comma , when received in a list (especially
idf it’s escaped….);
#P window linecount 1;
#P comment 542 222 187 196617 this is ok for formatting a message box;
#P window linecount 0;
#P newex 88 78 98 196617 t l b;
#P window linecount 1;
#P newex 136 149 27 196617 – 1;
#P window linecount 0;
#P newex 88 149 27 196617 – 1;
#P window linecount 1;
#P comment 476 358 318 196617 well , yous till have to send this to
the matrix object by banging it …;
#P newex 47 231 92 196617 pak srcdimend 0 0;
#P window linecount 0;
#P newex 59 256 100 196617 pak srcdimstart 0 0;
#P window linecount 1;
#P newex 488 184 218 196617 sprintf srcdimstart 0 %ld \, srcdimend %
ld 0;
#P outlet 47 356 15 0;
#P window linecount 0;
#P message 478 334 186 196617 srcdimstart 0 767 , srcdimend 719 0;
#P newex 488 298 62 196617 prepend set;
#P message 176 253 65 196617 usesrcdim 1;
#P newex 88 123 58 196617 unpack;
#P inlet 50 30 15 0;
#P comment 494 150 100 196617 shouldnt this work ?;
#P connect 9 0 6 0;
#P connect 8 0 6 0;
#P connect 3 0 6 0;
#P connect 1 0 13 0;
#P connect 13 0 2 0;
#P connect 2 0 11 0;
#P connect 11 0 9 1;
#P connect 2 1 12 0;
#P connect 12 0 8 2;
#P connect 13 1 3 0;
#P connect 4 0 5 0;
#P fasten 12 0 7 0 141 175 493 175;
#P connect 7 0 4 0;
#P fasten 11 0 7 1 93 175 701 175;
#P pop;
#P newobj 569 189 42 196617 p adapt;
#P user ubumenu 525 141 100 196617 0 1 1 0;
#X add 320 240;
#X add 640 480;
#X add 720 540;
#X add 1024 768;
#X prefix_set 0 0 0;
#P user jit.pwindow 355 277 322 242 0 0 0 0 0 0;
#P newex 356 244 303 196617 jit.matrix @usesrcdim 1 @srcdimstart 0
239 @srcdimend 319 0;
#P newex 376 141 146 196617 jit.gl.sketch bob @automatic 0;
#P newex 356 215 148 196617 jit.matrix bibi 4 char 320 240;
#P window linecount 4;
#P comment 628 131 100 196617 only 320 240 dim keeps the right
proportions , what am i doing wrong;
#P fasten 3 0 10 0 361 265 299 265;
#P connect 3 0 4 0;
#P connect 9 0 24 0;
#P fasten 8 2 9 0 604 185 690 185;
#P fasten 8 1 7 0 589 185 622 185;
#P connect 8 0 6 0;
#P connect 5 1 8 0;
#P connect 20 0 18 0;
#P connect 23 0 20 0;
#P connect 19 1 2 0;
#P connect 18 0 2 0;
#P fasten 16 0 21 1 43 102 344 102 344 42 380 42;
#P fasten 6 0 3 0 574 237 361 237;
#P connect 1 0 3 0;
#P connect 19 0 1 0;
#P fasten 7 0 1 0 622 210 361 210;
#P connect 21 0 19 0;
#P connect 22 0 21 0;
#P connect 16 2 17 0;
#P connect 16 3 17 0;
#P connect 14 0 12 1;
#P connect 11 0 25 0;
#P fasten 15 0 11 0 81 173 61 173;
#P fasten 16 1 11 0 61 131 61 131;
#P connect 12 0 16 0;
#P connect 13 0 12 0;
#P window clipboard copycount 26;


November 15, 2007 | 4:35 pm

using a message box:

max v2;
#N vpatcher 28 161 907 741;
#P origin 0 77;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 344 257 271 131137545 jit.matrix @usesrcdim 1 @srcdimstart 0 239 @srcdimend 319 0;
#P newex 344 226 127 131137545 jit.matrix bibi 4 char 320 240;
#P newex 44 220 265 131137545 jit.gl.videoplane bob @scale 1.333 1. 1. @blend_enable 1;
#P newex 674 257 147 131137545 jit.window bob @size 640 480;
#P newex 383 67 48 131137545 loadbang;
#P toggle 344 67 15 0;
#P newex 344 88 29 131137545 gate;
#P button 383 88 15 0;
#P newex 344 111 30 131137545 t b b;
#P message 383 111 115 131137545 reset , glreadpixels bibi;
#P newex 103 137 83 131137545 jit.gl.render bob;
#P newex 26 93 66 131137545 t b b b erase;
#P message 64 167 83 131137545 read dishes.mov;
#P flonum 73 51 35 9 0.5 0 1 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 26 51 15 0;
#P newex 26 72 57 131137545 qmetro 33;
#P newex 44 199 144 131137545 jit.qt.movie 320 240;
#P user jit.fpsgui 282 292 60 131137545 3;
#P newex 674 203 66 131137545 prepend size;
#P newex 558 179 40 131137545 t l l l;
#P newex 606 203 64 131137545 prepend dim;
#N vpatcher 774 455 1129 686;
#P window setfont Geneva 9.;
#P message 50 81 165 196617 srcdimstart 0 $2 , srcdimend $1 0;
#P outlet 50 129 15 0;
#P window setfont "Sans Serif" 9.;
#P message 116 135 186 131137545 srcdimend 639 0;
#P newex 116 115 62 131137545 prepend set;
#P newex 50 50 62 131137545 vexpr $i1 – 1;
#P inlet 50 30 15 0;
#P comment 133 155 100 131137545 shouldnt this work ?;
#P connect 1 0 2 0;
#P connect 2 0 6 0;
#P connect 6 0 5 0;
#P connect 6 0 3 0;
#P connect 3 0 4 0;
#P pop;
#P newobj 558 203 42 131137545 p adapt;
#P user ubumenu 513 155 100 131137545 0 1 1 0;
#X add 320 240;
#X add 640 480;
#X add 720 540;
#X add 1024 768;
#X prefix_set 0 0 0;
#P user jit.pwindow 343 291 322 242 0 0 0 0 0 0;
#P newex 364 155 136 131137545 jit.gl.sketch bob @automatic 0;
#P window linecount 4;
#P comment 616 145 100 131137545 only 320 240 dim keeps the right proportions , what am i doing wrong;
#P connect 11 0 10 0;
#P connect 10 0 14 0;
#P fasten 13 0 9 0 69 187 49 187;
#P fasten 14 1 9 0 49 145 49 145;
#P connect 9 0 23 0;
#P connect 12 0 10 1;
#P connect 14 2 15 0;
#P connect 14 3 15 0;
#P connect 25 0 8 0;
#P connect 20 0 19 0;
#P connect 19 0 17 0;
#P fasten 5 0 24 0 611 222 349 222;
#P connect 17 0 24 0;
#P connect 24 0 25 0;
#P fasten 4 0 25 0 563 249 349 249;
#P connect 25 0 2 0;
#P fasten 14 0 19 1 31 116 332 116 332 56 368 56;
#P connect 17 1 1 0;
#P connect 16 0 1 0;
#P connect 21 0 18 0;
#P connect 18 0 16 0;
#P connect 3 1 6 0;
#P connect 6 0 4 0;
#P fasten 6 1 5 0 578 199 611 199;
#P fasten 6 2 7 0 593 199 679 199;
#P connect 7 0 22 0;
#P pop;


November 15, 2007 | 4:47 pm

Thanks a lot Jash and Zach ,
it was definetly something stupid, ( couple neurones on vacation apparently )
sorry for the bandwith :)
take care

k


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