【发布时间】:2011-10-08 06:48:07
【问题描述】:
Maya的apiMeshShape插件要求我更改网格数据结构。所以现在我想使用 opengl 绘制一个以顶点-顶点结构表示的 3D 网格(如您在 en.wikipedia.org/wiki/Polygon_mesh 中所见)。
1)首先,我不知道如何表示顶点-顶点网格。请问下面的数据结构可以吗?
MPointArray vertices; //the position of all the vertices
MIntArray vertices_connects_counts; //how many other vertices each vertex connect with
MIntArray vertices_connects; //the index array storing each the vertices' index connected with all the vertices
以http://en.wikipedia.org/wiki/Polygon_mesh中的立方体为例。
vertices_connects_counts = {5,5,5,5,5,5,5,5,4,4};
vertices_connects = {1,5,4,3,9,
2,6,5,0,9,
3,7,6,1,9,
2,6,7,4,9,
5,0,3,7,8,
6,1,0,4,8,
7,2,1,5,8,
4,3,2,6,8,
5,6,7,8,
0,1,2,3 };
2)其次,如果上面的数据结构是正确的,我想知道如何使用 openGL 绘制网格?我应该将哪个参数传递给 glBegin()?
【问题讨论】:
标签: opengl plugins data-structures mesh maya