jit.matrix – moving away from 'setcell' towards a more object oriented approach
I’ve been getting along quite well with jit.matrix and setcell messages to create patterns and shapes on a low-res 2d matrix. For example, I can make a 1×1 pixel dot move across the screen from left to right, leaving a nice trail behind it:
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 591.3ocyVtsiZCCDF95jmBqndIEY6jPB8psOGUUHShKXjiCx1bnc09tWeHYW 1sjzrrPXkHX4IC1+ymGOCOFFDsr9HUEA9F3GfffGCCBblrFBZlGDUQNVvIJm aQB5g5kahl3ekldT6Lugomp3rRJ3A2vhx5CB.BNs0y5cZNUq+8Vpe2r+hEUD sjcLZBHJB7yFG+UsPqX+w4FBOE1XdKQWrlIVsPRKz9k.MCZdM.Oalc.kD6lY r87ZwJchyH3uhRZUhXWESXzhKdPmrqBRkaWi9tjQ3m3tW6N+wViOEFZ+ZxGC YZ.GrrS7XgxRhX0G.LHblcHFOMsGtDe23REUoHqn+CXJ3ThravbA.IN1CjLW lRrCKn7N.B9r.A+NAB55knTQ0xZyAH3ARglsmBPcBmKNiY9I7AgR66lz76Fe rEY1dfIL0V58dyKDn6KGw9fDAgOObtfMu2aG2rZC1H0WbDj.JVSjFEZ9LBES w9LAbuo.Ye1pkVTuSnoRv7NIDSncno4wN8xoTtCRYY8wny2uI8cxnjqdYjza ZcDOeRaRhx6si7cqNRWMdTTcAkyAeAYt0smvMvJ08.AvqZ+n1FzM0aSy6sgD 7pCJ21DwYh29e+bZ0Z+0zSUuSVzFvMmcfWDaIUoYBhlUKNwmjW4yZVYI085V tTxTjkbpKPgm8TbvpIY.xIezjS1.TCZDoS7PzCb7zCd.5IabwC5+gG7nomgj K+lizaJdfepNsleCUiupHY618TopYIcBwz8XSszNc1D2TlvO0shQR5dVq+og 1U6ov+BaeXXR -----------end_max5_patcher-----------
However, I’m beginning to see the limitations of this method. I would like to start looking at the dot as an object, that I can then apply movements to (e.g. move left 1px, move up 3px, etc). Or specify some other shape (a square, or an ‘L’) and move that around the screen.
Is there anything similar to this in Jitter?
I’ve had a quick look at some jit.gl tutorials but GL seems a bit advanced for what I want to do. I don’t need 3D shapes and textures, just basic colours and 2D shapes in very low-res. I’m generating patterns for LED arrays, not monitors/projectors.
However, if jit.GL is my only choice then I’m ready to get stuck in.
Maybe this kind of setup can serve as inspiration:
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 887.3ocyXtsbZCCDF9Z3oPimdQaFJUGrwPuh9bzoCivVATpQxURDnMSe2qN. DJ4.NJNNLDhFuVZ0u9X0p09t98RlK2xzIfuB9NnWu652qm2jyPucW2KYEcaQ EU66VxJlVSWvRFDtmgs03sqYhR4ZS8ZC3Zdkgo.UbAip12Qw5UbQEy38Bdmw qkBil+GlyFBODdeestZemQ6rFLY9cMKn2jDvO1cqZpoXIWrXlhUXB2kLlX8G .kNw2fCMiGBOLH2jKnq7dK4aJNsZuV4kdax427YLIwY6u86692fVGRNDwzl2 aJkm5aHwRIbLTRv1XG7CfTM8mfZola3RA.NL72iBnz2d.g896PXDJy0fguT. gxaQ.w1Vq.Zt3ie3ZzUng4e5J3vwOJfPcPDjCFC.SxBayfQxmz1lOERsmO32 U5flL9H5fHQRGRaSGKY9BBBuhLzR92W1jk6YCL1cVsYpmB4ZgKqLz9ACgOJY xdIjI8oHCWXy4aAztutKa.qBmhMIMRTgZQTcC2LbQ0va4kLYcEUv.SMJpPes TsxJbMy.vu9HK7SwO6zOaE0n3a8H7YSgm4SgS1m6N1Mgv1mdBYokaEzZyZEC f.SK4q.nQVd.lRKslAvWOCIOGCWTMyIJ6zeHbrArDC8aZwYn3X4jXPI0XTq4 wvC2HC0esjVyRZyS+RCfH0CBzD7C3gity1vKMKciHGcPTMBTia+XtEJdomCf oglc6dKjURkMFL7YptfVwrEdg1+8xXyLANxi3b+tXRVjoByaYttgaKreyaHh lSEKNKbRCEyOxinQQlmaT6GxorO1CScgPGr+Xf7HKTMqEoiALGvTTMqCHSXd NOdBUpFpI6kSm1rJ9eshYTR.g7F9rwd5bdnLxiiQQVgZTEuajKVT87AFMbMd tRKCKQxgSxOYId7S4mbvKJ6h1Vn7LlfNuxOSviVj9Am3d+Om7pk7Suy9+ux0 x0ph85MTev.v8RnjoMbA089.NpO15wNtSK4kkL+82GCTx0NwUdp5FDkbPmQN 4clZv3FPmIcmbHWTxw87rmO1w8qEtazSS905DQ+lpGRS4C5BhOjtiOnlnGbm omFENi5N7j2.8zc4BGeQolzFbNQ1EUjS2ollj1o6xB1jjNwlyIT8Cst9VlRu ykdgXqv6Fo+EQLZf+RtHbo2iIJ1s788Ouuya+s++.XwXicF -----------end_max5_patcher-----------
Thanks Wesley, that’s pretty cool actually. This is moving towards what I want – defining a shape (gridshape), and then move that shape around (position).
My LEDs will be behind opaque perspex so the filter you’ve added to the pixels makes it look a little more like it will do on the hardware itself.
Definitely inspired now!
Hi Wesley (and all),
I had a look into using jit.gl, and there are a lot of things about it that I quite like. It definitely has the more object-oriented approach I was looking for, whereby each of my ‘object’ on the screen can be generated by a jit.gl.gridshape, and I can move them around independently.
There are, however, a couple of things that perhaps make it not so good for my purposes. As I said in my original post, I’m working with very low-res matrices (8×8 pixels). My ‘objects’ tend to be 1×1 pixels, and move around pixel to pixel. GL, by it’s very nature, does not deal with pixel accurate placement of an object. Instead, it positions objects by co-ordinates in a 3d space, and then works out the pixel placement depending on your resolution (makes perfect sense for creating images that are compatible with any screen res). The problem that makes for me is that if I move my object across the screen, sometimes it takes up 1 pixel, sometimes 2 (as it crosses a pixel border), and sometimes none, effectively hiding the object.
So I’m still looking for a a method that is more suited to my needs. I would still be interested to hear any suggestions. Thanks.
Forums > Jitter