jitter object outlets, gl matrix output and jit.gl.lua


    Nov 09 2007 | 1:42 pm
    hi-
    i'm in a study group studying jit.gl.lua and advanced
    processes on the manipulation of vertices...
    how do you access inlets / outlets (including matrix output from jit.gl.model - or any other gl object with matrix output - for instance...) in jit.gl.lua internally via code?
    we could not find a demo patch example doing anything like this.
    forgive me if im wrong.
    does this seem to be the best way to handle advanced manipulations of vertices in lua?
    for instance, we would like to take a complex model (.obj) and have access to all the vertices for procedural manipulation...would accessing the matrix output be the way to go?
    thanks,
    the gl study group
    ps to be clear, we would also like to know, in general, how to handle inlets and outlets from jitter objects in jit.gl.lua...

    • Nov 09 2007 | 6:04 pm
      i think it's something like this:
      model = jit.new("jit.gl.model", render_context)
      model.matrixoutput = 1
      mat = jit.matrix("data")
      mat = model:draw()
    • Nov 09 2007 | 7:26 pm
      jit.gl.lua has a matrixoutput object but it's not really functional.
      It's there because of the way jit.gl code is structured. You can use
      outlet(0, "msg") just like in JS to send data out of jit.gl.lua and
      you can set the number of outlets via the numoutlets attr.
      wes
      On 11/9/07, Robert Ramirez wrote:
      >
      > i think it's something like this:
      >
      > model = jit.new("jit.gl.model", render_context)
      > model.matrixoutput = 1
      > mat = jit.matrix("data")
      > mat = model:draw()
      >
    • Nov 14 2007 | 9:45 pm
      i think brian's question was more about connecting *internally* in jit.gl.lua...
      e.g. how do you connect from the outlet of a jit.gl.slab to the right inlet of another jit.gl.slab in code?
      or in the case of matrix transformations, how do you gain access to the data coming out of a jit.gl object instantiated in jit.gl.lua with matrixoutput enabled?
      cheers,
      mark
    • Nov 14 2007 | 10:08 pm
      ok for slab it goes as follows:
      slab = jit.new("jit.gl.slab", this.drawto)
      slab.texture = {"tex0", "tex1", "tex2"}
      slab:draw()
      in the case of slab, the inlets correspond to textures in the list for
      the texture attribute.
      For matrix output, I'm not sure and I'm inclined to say it doesn't
      work because hat's part of the maxwrapper.
      wes
      On 11/14/07, m. cera wrote:
      >
      > i think brian's question was more about connecting *internally* in jit.gl.lua...
      >
      > e.g. how do you connect from the outlet of a jit.gl.slab to the right inlet of another jit.gl.slab in code?
      >
      > or in the case of matrix transformations, how do you gain access to the data coming out of a jit.gl object instantiated in jit.gl.lua with matrixoutput enabled?
      >
      > cheers,
      > mark
      >
      >
      >