How to crop image and get clamping effect with [jit.gl.pix]

Doug MeatLoaf's icon

Hello All.
I need some help.

I began lately to get familiar with [jit.gl.mesh].
I'm trying to stretch 2D images horizontally.
I have found a way I like by changing the X coordinates of jit.gl.mesh first input (the vertex array input).
I like the effect of stretching horizontally an image from specific columns cells. I'm able to achieve this effect on small matrices by the use of [jit.fill].
I would like to be able to use bigger 2D geometry matrices to gain some precision.

My question concern filling matrices with values : How could I, let's say a 50x50 matrix, change the value of all the cells of column 20 without the need to enter each cell's value like I'm doing with [jit.fill] in the patch I've join?

Is there a formula or an object or a way to think to problem that could help me with this?
Thanks for your help.

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

Doug MeatLoaf's icon

I've found some examples with [jit.expr] that could eventually lead me to the expression I'm looking for.
Found them in the Max for the Visual Arts package.

Doug MeatLoaf's icon

Hello again.
So I've been exploring [jit.gl.pix] for the last day to get the effect I'm looking for.
It seems like it could do it but I can't figure out how.
The effect I'm looking is basically what [sample] does with boundmode attribute set to clamp.
How could I move the clamping effect into the image I'm feeding [jit.gl.pix] with, kind of cropping the image and from the crop limit get the clamp effect?

I've been struggling with this for the last few days, looking around the forum and trying different approach.
The closest I got was with [jit.gl.mesh] by moving horizontally the coordinates vertex like the patch I posted above.
I then thought that working directly on the texture would maybe work better.
Here a patch to have an idea of the effect I'm looking for.
I hope my explanation are clear.
I would really appreciate any kind of help.
Cheers.

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



Martin Beck's icon

Like this?

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

Otherwise you can also use the [jit.gl.slab @file td.fisheye.jxs] with appropriate scalings you get a similar effect e.g. https://cycling74.com/forums/how-to-make-those-stunning-videogame-glitches-!/replies/1#reply-5ce70f7771e603431be84946

Doug MeatLoaf's icon

Exactly Martin!
Thank you very much for your help.
It is really appreciated.
Cheers!