texcoords on jit.gl.mesh

Curly's icon

Can anyone tell my small brain what I should do to correct the texture coordinates in the patch below so that the texture fills the whole plane that is created?
(My end goal is to create a patch so I can move the corners of my texture to make irregular, rhomboid shapes so in order to correct for projection distortions. Like an irregular keystone kind of thing.)

Max Patch
Copy patch and select New From Clipboard in Max.

MJ's icon

im not sure but

texture coordinates cannot be less than 0
between 0.0 and 1.0

so make a separate matrix for the texcoords

Rob Ramirez's icon

on the gl.mesh, try:
tex_map 1
tex_plane_s 0.5 0. 0. 0.5
tex_plane_s 0. 0.5 0. 0.5

attach this to your gl.mesh to adjust further (courtesy of wes smith)

Max Patch
Copy patch and select New From Clipboard in Max.

Curly's icon

brilliant! just the info I needed.
I just added a pictslider in a subpatcher that lets me move the corner of the plane around so I can cornerpin it to a projection surface.
thank you both. you rule!

max v2;
#N vpatcher 535 184 1608 961;
#P origin 0 6;
#P button 175 64 15 0;
#P window setfont "Sans Serif" 9.;
#P message 241 109 30 196617 read;
#P newex 242 136 138 196617 jit.gl.texture foo @name tex;
#P button 129 65 15 0;
#N vpatcher 596 366 1460 882;
#P window setfont "Sans Serif" 9.;
#N vpatcher 562 141 1162 541;
#P outlet 160 269 15 0;
#P outlet 60 270 15 0;
#P window setfont "Sans Serif" 9.;
#P flonum 156 236 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 61 236 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 157 206 40 196617 / 100.;
#P newex 60 208 40 196617 / 100.;
#P flonum 157 174 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 61 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user pictslider 66 60 100 100 4 4 4 4 SliderDefaultKnob.pct 1 SliderDefaultBkgnd.pct 1 2163 0 13172536 -13107000 1. 1.;
#P connect 1 0 3 0;
#P connect 5 0 7 0;
#P connect 0 0 1 0;
#P connect 3 0 5 0;
#P connect 4 0 6 0;
#P connect 0 1 2 0;
#P connect 2 0 4 0;
#P connect 6 0 8 0;
#P pop;
#P newobj 222 65 78 196617 p movecorner1;
#P flonum 683 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P inlet 522 60 15 0;
#P outlet 447 377 15 0;
#P newex 447 347 118 196617 jit.matrix 2 float32 2 2;
#P message 574 281 119 196617 setcell 1 1 plane 0 val 0;
#P message 574 300 119 196617 setcell 1 1 plane 1 val 1;
#P window setfont "Sans Serif" 12.;
#P comment 582 115 113 196620 texture;
#P window setfont "Sans Serif" 9.;
#P newex 520 102 30 196617 t b b;
#P button 540 126 15 0;
#P message 577 239 119 196617 setcell 0 1 plane 0 val 1;
#P message 577 258 119 196617 setcell 0 1 plane 1 val 1;
#P message 577 216 119 196617 setcell 1 0 plane 1 val 0;
#P message 577 198 119 196617 setcell 1 0 plane 0 val 0;
#P message 577 176 119 196617 setcell 0 0 plane 1 val 0;
#P message 577 157 125 196617 setcell 0 0 plane 0 val $1;
#P inlet 162 58 15 0;
#P outlet 87 375 15 0;
#P newex 87 345 118 196617 jit.matrix 2 float32 2 2;
#P message 214 279 124 196617 setcell 1 1 plane 0 val -1;
#P message 214 298 119 196617 setcell 1 1 plane 1 val 1;
#P window setfont "Sans Serif" 12.;
#P comment 222 113 113 196620 vertices;
#P window setfont "Sans Serif" 9.;
#P newex 160 100 30 196617 t b b;
#P button 180 124 15 0;
#P message 217 237 119 196617 setcell 0 1 plane 0 val 1;
#P message 217 256 119 196617 setcell 0 1 plane 1 val 1;
#P message 217 214 124 196617 setcell 1 0 plane 1 val -1;
#P message 217 196 124 196617 setcell 1 0 plane 0 val -1;
#P message 217 174 125 196617 setcell 0 0 plane 1 val $1;
#P message 217 155 125 196617 setcell 0 0 plane 0 val $1;
#P connect 7 0 11 0;
#P connect 0 0 11 0;
#P connect 1 0 11 0;
#P connect 2 0 11 0;
#P connect 3 0 11 0;
#P connect 5 0 11 0;
#P connect 4 0 11 0;
#P connect 10 0 11 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 29 1 7 0;
#P connect 29 0 7 0;
#P connect 13 0 7 0;
#P connect 7 1 6 0;
#P connect 6 0 10 0;
#P connect 6 0 9 0;
#P connect 6 0 0 0;
#P connect 29 0 0 0;
#P connect 6 0 1 0;
#P connect 29 1 1 0;
#P connect 6 0 2 0;
#P connect 6 0 3 0;
#P connect 6 0 5 0;
#P connect 6 0 4 0;
#P connect 23 0 25 0;
#P connect 24 0 25 0;
#P connect 18 0 25 0;
#P connect 19 0 25 0;
#P connect 17 0 25 0;
#P connect 16 0 25 0;
#P connect 15 0 25 0;
#P connect 14 0 25 0;
#P connect 21 0 25 0;
#P connect 25 0 26 0;
#P connect 27 0 21 0;
#P connect 21 1 20 0;
#P connect 20 0 24 0;
#P connect 20 0 23 0;
#P connect 20 0 14 0;
#P connect 28 0 14 0;
#P connect 20 0 15 0;
#P connect 20 0 16 0;
#P connect 20 0 17 0;
#P connect 20 0 19 0;
#P connect 20 0 18 0;
#P pop 1;
#P newobj 128 95 58 196617 p texcoord;
#P message 338 396 85 196617 poly_mode $1 $1;
#P toggle 338 373 15 0;
#P message 287 235 40 196617 reset;
#P newex 287 259 209 196617 jit.gl.handle foo @auto_rotate 1 @radius 1.5;
#P newex 39 259 99 196617 prepend draw_mode;
#P user ubumenu 40 236 68 196617 0 1 1 0;
#X add points;
#X add lines;
#X add line_strip;
#X add line_loop;
#X add triangles;
#X add tri_strip;
#X add tri_fan;
#X add quads;
#X add quad_strip;
#X add polygon;
#X add tri_grid;
#X prefix_set 0 0

MJ's icon

post some results of you videomapping on youtube