the mysterious jit.gl.mesh' index and edgeflag arrays

Julien Bayle's icon

Hello,
I exaggerated with title of the post.
Is there a place where I could find some documentation related to these two matrices ?

Can we control which edge is drawn using this ?
I tried to set lines draw mode, but what kind of index array matrix am I supposed to feed for drawing this or that edge (lines) ?

I retrieved a patch Rob answered to a previous of my post, but if I change the content of the matrix, it still doesn't work

Max Patch
Copy patch and select New From Clipboard in Max.

I'd like to know if with this index array, I can :
- control which edge is drawn or not in lines draw mode,
- control which face (triangles) is drawn or not and how, in triangles mode

any input or help would be appreciated a lot.


Julien

Julien Bayle's icon

empirically ways didn't make me reach the right one :-(

Rob Ramirez's icon

when I look at the source code it does look like the edgeflag matrix is functional (for the default vertexarray cache_mode), however I would assume this has never been used, and should probably be considered deprecated (e.g. it is no longer supported in gl3 with the core profile).

I also don't thing there are any use cases for edgeflag that are not better handled by the index array matrix.

you can use the index matrix to both control which lines are drawn and which triangles are drawn in their corresponding modes. you simply provide the index of the vertex you want for each point in the line or triangle.

here's where I'd start for more info on mesh index drawing:

Nodanoma's icon

I find it a bit tricky setting up the index_array matrix, however, for a simple line-setup we can multiplex generated coords, exclude the connections between lines and offset the vertical indices accordingly to achieve parallel lines for jit.gl.mesh like so:

Max Patch
Copy patch and select New From Clipboard in Max.


perhaps the application of an index_array for other draw_modes or shapes, for that matter can somehow be extrapolated from this.

draw_mode lines yields only every second pair to be connected, when drawing as line_strip or line_loop the parallel lines are full but connected between each other.