jit.matrix - moving away from 'setcell' towards a more object oriented approach

    Aug 31 2012 | 9:21 pm
    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 1x1 pixel dot move across the screen from left to right, leaving a nice trail behind it:
    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.

    • Aug 31 2012 | 10:44 pm
      Maybe this kind of setup can serve as inspiration:
    • Aug 31 2012 | 11:59 pm
      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!
    • Oct 27 2012 | 4:43 pm
      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 (8x8 pixels). My 'objects' tend to be 1x1 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.