jit.gl.multiple and control of instances


    Oct 04 2012 | 8:34 pm
    hi there,
    I have a collection of gridshape objects multiplied by jit.gl.multiply
    Of course, we can easily control positions, scales etc with matrices feeding jit.gl.multiply
    but my problem is that one:
    I want to control very independantly (and efficiently) some objects movements.
    for instance, I have a 4x4 square matrix of square (I mean an array of 4x4 gridshape planes)
    I want to bang something and to have the (2,3) moving on z axis, then returning back to the initial position etc continuously, with a kind of easing even a basic linear one.
    I'd like to do that with gen, but it would involve to track something during time which I didn't do yet.
    anyone here?

    • Oct 04 2012 | 8:41 pm
      jit.slide can be very useful for this kind of thing.
    • Oct 04 2012 | 9:15 pm
      I played with it.
      I guess I have two ways to make a particular instance move, then come back:
      - keeping the current position (it is implicitly done by gen I guess)
      - when triggering the change, delay the coming back to the first value
    • Oct 05 2012 | 8:58 pm
      try it more like this:
    • Oct 05 2012 | 9:16 pm
      hi robert and thanks.
      I finally did almost exactly what you proposed, playing with scale.
      yours is very nice.
      about the final rendering/display, I always have to play with the cam position, lens etc
      I mean, i have to find my magic numbers to initialize the patch and it is a bit annoying and especially, I don't know if it is the best practice.
      wouldn't there be something like a template I could make to have always all my display center like inside a canvas ?
      I don't know if this question make sense. It is more: i "only" need to have everytime the same cam position/zoom, looking at the same point because I want to display only objects, colored areas etc as if I was in "processing"
      If I may ask, how would you do that ?
    • Oct 05 2012 | 9:27 pm
      i would use gl.render @ortho 1 or 2 for 2D gl scenes.
    • Oct 05 2012 | 9:36 pm
      ok Robert.
      I mean more about the global canvas.
      I'm still hesitating to use jit.gl.sketch in order to directly draw "on the screen" in 2D I mean, create area on the screen, color it or not depending on external triggers etc
      I don't know if it would be more or less efficient, but it would be a nice way for me.