ganzo

12-28-2010, 05:50 AM

Hey guys,

I'm in the process of building procedural geometry and wanted to ask a quick question about the arrays used to build a mesh.

I see that the 3 basic arrays that one needs are the following:

Vertex master table: An array containing MFloatPoint objects....just wondering...so then MPoints are doubles?

Per face vertex count: An int array where nth polygon is is the nth element. And values are the number of vertices for such poly.

Vertex Connection Array: This is where the whole thing catches my eye. I was hoping to see something similar to the vertex master table with some array holding objects representing the points per face. Instead this is just a sequential array so I assume one has to use this in conjunction with the per face vertex array to determine how far should an iterator look in the array to get the points that make up a polygon.

I just thought of this as a very odd way of planning the vertex per face array since the vertex master table made up of point objects is something more of what I expected. I get the fact that the vertex count per face is not fixed, so I was wondering if it was more of a hassle to deal with a data structure to hold variable amounts of vertexes per face.This feels more laborious and was wondering if any of you have created your own data structure for such a task or am I overlooking some data structure that has been implemented in maya that I am not aware of?

And what about an edge list? I see you can get it or pass it to some functions, but what is the format of such array? Could not find it...is it just a [n][2] array of n edges with the index values of 2 points?

I'm in the process of building procedural geometry and wanted to ask a quick question about the arrays used to build a mesh.

I see that the 3 basic arrays that one needs are the following:

Vertex master table: An array containing MFloatPoint objects....just wondering...so then MPoints are doubles?

Per face vertex count: An int array where nth polygon is is the nth element. And values are the number of vertices for such poly.

Vertex Connection Array: This is where the whole thing catches my eye. I was hoping to see something similar to the vertex master table with some array holding objects representing the points per face. Instead this is just a sequential array so I assume one has to use this in conjunction with the per face vertex array to determine how far should an iterator look in the array to get the points that make up a polygon.

I just thought of this as a very odd way of planning the vertex per face array since the vertex master table made up of point objects is something more of what I expected. I get the fact that the vertex count per face is not fixed, so I was wondering if it was more of a hassle to deal with a data structure to hold variable amounts of vertexes per face.This feels more laborious and was wondering if any of you have created your own data structure for such a task or am I overlooking some data structure that has been implemented in maya that I am not aware of?

And what about an edge list? I see you can get it or pass it to some functions, but what is the format of such array? Could not find it...is it just a [n][2] array of n edges with the index values of 2 points?