coords of 3d cube as a single matrix?

    Apr 11 2014 | 10:03 pm
    I know this is basic.. but jitter has remained a frustration for me since day one - and my shitty math skills don't help the matter. :/
    I need to enumerate the coordinates for a cube of a given dimension and store them as a single matrix which can then be rendered as a set of points in openGL.
    I can generate the coords for a single 'slice' of a cube (using jit.expr to normalize the values of an input matrix), but it's not clear to me (1) how to render the entire cube (I assume a combination of mesh + multiple would work?) and (2) the best way to store all the coords of the cube as a single matrix. The latter might not be necessary, but I need to be able to easily apply functions to all of the coords.
    I hope that makes sense. I have been at this for days and my brain hurts.

    • Apr 12 2014 | 8:23 am
      Not behind my computer right now. But if im right the object has around 5 to 6 inlets, the 1st inlet is the vertex array, so each vertex should have 3 pieces of data, xyz location. Feed in 8 vertex and you should have a cube, draw them in the right order or the drawing method could get messy. To be sure how jitter wants the vertex array I think you can also get a (set shape to cube) set matrix_out to 1, plug this into a jitter.matrix and see how the data is being sent out.
    • Apr 12 2014 | 12:21 pm
      And if im correct you have to send in more than a single matrix for I'd check the reference file.
    • Apr 12 2014 | 7:38 pm
      Andro, thanks very much for the reply!
      Ya know, I think the best way to work this out is to enumerate all coordinate values of a cube into a single matrix. I can do that in Max with cascading uzis.. storing the coords in a coll and then dumping w/ setcell to fill a matrix. That way works like a charm. Very straight forward.
      It appears that my only snag is figuring out how to enumerate all values of a cube (of n-dimension) within jitter. I need to somehow iterate or loop values within jitter and I don't know how do that. Better yet, I need to figure out how to enumerate the coords inside jit.gen... I need it to be as fast as possible.
      I will post an example later today.
      Thanks again for helping out.
    • Apr 12 2014 | 8:07 pm
      Hopefully this is clearer...
    • Apr 14 2014 | 6:32 pm
      i would try something like the following:
    • Apr 15 2014 | 3:07 am
      Yes! Thank you Rob!
    • Apr 22 2014 | 1:57 am
      Hmm... I've been having the damnedest time getting to output a matrix. Does @matrixoutput 1 not do this?
      I assumed that I could specify coords for the mesh and then rotate the object with updated coords sent out the left outlet of as a matrix. Apparently that's not the way it works? :/
    • Apr 22 2014 | 12:56 pm
      hi, you could do the rotation in gen. It's more easy if you want to find coords points . mathieu
    • Jun 15 2016 | 5:49 pm
      here's an example building a cube completely in [gen]. I was getting rounding errors so there's a healthy use of [trunc] and [floor] objects.
      i'm not completely pleased with it because the coordinates don't actually extend from (0,1), but it's definitely a start.
    • Jun 15 2016 | 6:24 pm
      ok ignore the above and the issue about the coordinates, that was an insanely easy fix: