Taking inspiration from Jitter Recipe #36 http://cycling74.com/2010/09/13/jitter-recipes-book-3/,
I started working on a patch that grabs single frames and sends them to a matrix in a "mosaic" fashion. What I was trying to obtain was that the size of the "tiles" varies according to frames number. Hence, a single frame takes all the screen, two frames split it in a half and so on.
I'm almost there. I found the way to create a square grid that adapts to the number of frames, and I can use this info to control the mesh and to feed the texture (as in the "TinyVideo" recipe)
Now I'm stuck in correctly set the vertical position of the frames in the matrix that will become the texture. It seems I can't figure out the correct math.
Please have a look at this patch. Try clicking a few times. It seems to work somehow for some values, but at the beginning it outputs values too high for the "row" coordinates, while the "columns" are set correctly.
Any hint would be appreciated.