Apply premultiplied 3x3 transformation matrix to an image


    Oct 07 2018 | 1:16 pm
    Say I have a premultiplied perspective transformation in shape of a 3x3 float matrix (list of 9 floats respectively), how would I apply that to a video most effectively using jit.gl or Gen? The jit.gl objects seem to only accept explicit rotation, translation and scaling parameters.
    Basically I would like to have jit.mxform2d as a jit.gl.pix configuration.
    I just can't figure out how to get a 3x3 matrix into a gen patcher without being resampled. And I cannot get it in as individual values, because pix takes at most 8 ins.

    • Oct 09 2018 | 8:09 pm
      here's how i'd port mxform2d into gl.pix. by simply creating a param for each element of the equation in the mxform2d help file you can plug them directly into an expr object in the gen patcher.
      i forgot how much fun these transforms can be.
    • Oct 09 2018 | 9:04 pm
      Awesome! Exactly what I was looking for. I must confess, I'm reading documentation for other programming languages quite frequently, but I find Max documentation cryptic and hard to find, often enough. Your clean and simple code taught me more about "param" and "expr" inside Gen than hours of sweeping through docs and tuts did. Thanks a million.