jit.gl.mesh index matrix example?

    Dec 14 2013 | 2:52 am
    Hi everyone,
    I'm trying to figure out how to use an index array to tell jit.gl.mesh which vertices of my vertex array to draw.
    Could anybody share any working examples of how to go about creating such an index array?
    I've been searching in the forums and beyond, but haven't been able to find any sort of patch that uses an index array or explains how to do it. Any help would be greatly appreciated!

    • Dec 16 2013 | 8:49 am
      First of all, I have no idea what the answer to your question is. But I'm still going to try to help.
      I’m trying to figure out how to use an index array to tell jit.gl.mesh which vertices of my vertex array to draw.
      jit.gl.mesh requires a matrix to create a geometric surface, so keep that in mind.
      If you're going to have a "normal-average-everyday" 3d model/animation then you should definitely model it in something like Blender or Maya and then load the model in with jit.gl.model.
      However, you might want to do something more special when creating your 3D object, you could try generating the object with jit.gl.isosurf. Take a look at Day 5 at the following link: https://cycling74.com/wiki/index.php?title=Gen_Patch-A-Day
      This patch explores the use of jit.gen to generate 3D matrices for use with jit.gl.isosurf.
      Hopefully this helps!
      |\|athan |)anziger .(om
    • Dec 16 2013 | 7:05 pm
      basic example:
    • Dec 16 2013 | 7:22 pm
      Thanks Rob, this is what I was looking for.
      Now, I'd like to tell jit.gl.mesh to only use those coordinates in the vertex array that have z = 0. Any idea how I would go about doing that?
      My first idea was to iterate over the vertex array and test for z = 0, then put those coordinates that pass into another matrix which functions as the index array. Do you think that would work? I don't have access to Max right now, so I can't try it out at the moment...
      Thanks for the help!
    • Jan 22 2015 | 11:39 am
      I was looking to increase performances of my mesh generation in using the indexation vertices technics. I found your patch above usefull to see how it works but for me it won't increase performances because we don't use the shared vertices.
      For me the correct example for indexation vertices will be something like this
      Can you please tell me if i'm right / wrong or if it is the same or if you make something internal to the gl.mesh object to find automatically the shared vertices and ignore them?
    • Jan 22 2015 | 6:54 pm
      hi nesifao. no, there is no mechanism in gl.mesh that automatically ignores shared vertices. so yes, your example is a better demonstration of this feature.