Forums > Jitter

[sharing is sharing] jitter recipe for flowfield / mesh generation

January 30, 2012 | 1:15 pm

my dearest cyclists,
since i got some nice feedback from this forum when sharing my basic homography solution ( i thought i could give it another go and add a software tab on my homepage.

it now contains "h.lines", which is some kind of jitter recipe for flowfield stuff and mesh generation from video input. nothing massively spectacular, but it might be a good starting point for your own experiments.
i am using Wesley Smith´s xray.jit.cellcoords from

attached is a screenshot of what h.lines does (or can do),
you can watch it in full blown action here:

download it here:

hope you like it, and sorry for the grumpy video, but the track is called "grump" after all.

humbly, hons


  1. h.lines.example.jpg
January 30, 2012 | 7:35 pm

This is super beautiful. Congrats!
If you have Max6, it looks like you’ll be able to make good use of jit.gen with the kind of things you’re doing in this patch. The only thing I say that isn’t possible in jit.gen is mimicking what xray.jit.cellcoords does, which will have to wait until the jitter gen objects can take non-uniform inputs. Looking forward to seeing how this develops!!

January 30, 2012 | 8:52 pm

yeah, I’ve been playing around with this, it looks amazing. The only downside is that I couldn’t seem to get that draped cord look that your demo pictures had; many of my scenes ended up like one of those inflatable balloon men :-/

I suspect wizardry, or at least a keen sense of your own patch letting you tweak it properly. My own experience in this sort of patch tell me that there are many sweet spots that can be hard to find.

OH, and I meant to say; nicely laid out patch – I love how I can actually read this bugger, and do sensible edits of my own. Cheers for that work.

January 31, 2012 | 12:42 pm

thanks for your comments !
@wesley: as far as i can remember i have tried to do a lookup via shader once, but at that time the gpu i was working on was very slow with float32 textures, and in the end it turned out that xray.jit.cellcoords worked much smoother. but i will have a look at it again – as soon as i can jump on the max 6 wagon (looking forward to it ..)
(and thanks for the xray objects, btw – love it!)

@wetterberg: the screenshot only shows the presets that i hopefully included in the download (did i?) with the top left being the input (almost black and white) – the draped cord look is more a result of the input than of wizardry (so i am sorry for your inflatable balloon men ;-)
if the input picture is "smooth" (not too grainy, properly lit or somehow softened ..) it should be fairly easy to get this look. in the "FORMULA" subpatch i have only used hue and saturation as a means of influencing the curvature, so if your input has smooth changes in h&s, the result will be draped cords.

January 31, 2012 | 2:13 pm

Incredible- great work, hons!

February 1, 2012 | 10:46 am

It looks great !!! Thank you for sharing !

February 1, 2012 | 4:39 pm

0_0 waaaaw! thank you!!!

February 1, 2012 | 5:26 pm

Hi hons,

great work!

However, after some minutes (h.lines.maxpat) Max crashes…

It seems related to xray object; maybe not completely compatible with max6?

Here attached the crash log, maybe could be useful.


iMac 3.05
Osx 10.6.8
Max 6.0.3

  1. crash.rtf
February 1, 2012 | 8:50 pm

thanks for the pointers, hons. Again, great work – always nice to see a new take on things.

February 2, 2012 | 10:39 am


February 2, 2012 | 1:47 pm


crashes on Max 5 as well. In a rather unpredictable way but reliably after some minutes (or less). Too bad, it´s so nice!

February 2, 2012 | 1:48 pm

I saw the xray objects turning up 4-ish… something there maybe?

February 2, 2012 | 2:11 pm

Nope, been running xray.jit.cellcoords for some time now. No crash…. hmmm

February 2, 2012 | 3:27 pm

thank for the replies and bug reports. this is not easy to track – but matpe´s log shows that it might in fact be related to xray.jit.cellcoords.

i tried to shrink down the whole thing and came up with this little stress tester for jit.xray.cellcoords that crashes max quite easily ( mostly in a matter of seconds, i am on max 5.1.4, osx 10.6.8) ..

i´ll look where i can file a bugreport for the object – wesley, you here ?

best, hons

February 5, 2012 | 11:02 pm

If you clamp the second input’s values to be 1-less than the first inputs dimensions, it won’t crash. I’ve fixed this in the source, but if you’re using the old version, that will fix it as well. Here’s an OSX compiled xray.jit.cellvalue that fixes the crash.

February 6, 2012 | 5:40 am

Great work, thanks for sharing.

I am wondering how possible it is to assign color values to the generated meshes in order to get different effects for the different color values.

Example – everything that is red make it a line, everything that’s blue make it a line loop etc.

I know this can be done in java via Processing storing pixel value of each frame assign to color, but don’t know if this could be done in this patch through a pre sorting out of the matrix or after it passes through the xray.jit.cellvalue

just and idea.

February 6, 2012 | 8:27 pm

amazing, thank you so much!

February 22, 2012 | 8:26 am

Super cool, and a nice learning patch! thank you so much!

March 24, 2013 | 12:26 pm

I’m trying to work out how to record the output of this patch, but am having no luck. Although I’ve been using Max for a while my knowledge of Jitter is a little patchy (no pun intended). I’ve got a feeling I need to use but can’t work out the correct settings. Any pointers appreciated..

March 24, 2013 | 5:33 pm

You mean record to a video file? Some options:
1. use screen capture software, no max patching
2. use to grab the rendering output to a matrix and send that into jit.qt.record or jit.vcr (bit rusty here, recording objects names might be a bit different)
3. if on Mac, use syphon to send to the GL output to a recording application, see

March 24, 2013 | 8:28 pm

Yeah exactly – record to video file, preferably from within Max.

I’ll check out first when I get a minute. Syphon also looks really interesting though.

Thanks for the advice, I’ll keep you posted.


April 1, 2013 | 9:26 am

@dtr Thanks again, the Syphon solution is working pretty well for me, or at least it’s good enough for my needs right now. I’m just starting to get more into the Jitter side of things and syphon looks like it’s going to be handy to know.

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

Forums > Jitter