Forums > Jitter

jit.gl.mesh index matrix example?

December 13, 2013 | 6:52 pm

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!

Jonas


December 16, 2013 | 12: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: http://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


December 16, 2013 | 11:05 am

basic example:
<code>

– Pasted Max Patch, click to expand. –

</code>


December 16, 2013 | 11:22 am

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!


Viewing 4 posts - 1 through 4 (of 4 total)