Opengl es 使用GLDrawerElements绘制此数据时应使用哪些参数?

Opengl es 使用GLDrawerElements绘制此数据时应使用哪些参数?,opengl-es,indices,Opengl Es,Indices,我正在尝试加载如下所示的ply格式: 0.000000 0.000000 -1.543509 0.000000 0.000000 -1.000000 0.838731 0.300864 106 34 22 vertex pos/ normal dir/texture coords/ vertex color 3 0 1 2 how much vertices per face/ which vertex for x/ which vertex for y/which vertex for z/

我正在尝试加载如下所示的ply格式:

0.000000 0.000000 -1.543509 0.000000 0.000000 -1.000000 0.838731 0.300864 106 34 22
vertex pos/ normal dir/texture coords/ vertex color
3 0 1 2
how much vertices per face/ which vertex for x/ which vertex for y/which vertex for z/
//bind buffer first of course)
glDrawElements(GL_TRIANGLE_FAN,vert_amount,GL_UNSIGNED_INT,faces);
脸的定义如下:

0.000000 0.000000 -1.543509 0.000000 0.000000 -1.000000 0.838731 0.300864 106 34 22
vertex pos/ normal dir/texture coords/ vertex color
3 0 1 2
how much vertices per face/ which vertex for x/ which vertex for y/which vertex for z/
//bind buffer first of course)
glDrawElements(GL_TRIANGLE_FAN,vert_amount,GL_UNSIGNED_INT,faces);
然后我把它们读入顶点数组和面数组,像这样画:

0.000000 0.000000 -1.543509 0.000000 0.000000 -1.000000 0.838731 0.300864 106 34 22
vertex pos/ normal dir/texture coords/ vertex color
3 0 1 2
how much vertices per face/ which vertex for x/ which vertex for y/which vertex for z/
//bind buffer first of course)
glDrawElements(GL_TRIANGLE_FAN,vert_amount,GL_UNSIGNED_INT,faces);
我使用的是opengles 1.1,所以我一直使用TRIANGLE_FAN,我想,结果很糟糕,所以我想默认的铺层面定义不适合opengl,对吗?如果我想使用GLD元素,如何重新组织面

以下是ply模型文件的简单多维数据集:

1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000
1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000
-1.000000 -1.000000 -1.000000 0.000000 0.000000 -1.000000
1.000000 0.999999 1.000000 -0.000000 0.000000 1.000000
-1.000000 1.000000 1.000000 -0.000000 0.000000 1.000000
-1.000000 -1.000000 1.000000 -0.000000 0.000000 1.000000
1.000000 1.000000 -1.000000 1.000000 -0.000001 -0.000000
1.000000 0.999999 1.000000 1.000000 -0.000001 -0.000000
0.999999 -1.000001 1.000000 1.000000 -0.000001 -0.000000
1.000000 -1.000000 -1.000000 -0.000000 -1.000000 -0.000000
0.999999 -1.000001 1.000000 -0.000000 -1.000000 -0.000000
-1.000000 -1.000000 1.000000 -0.000000 -1.000000 -0.000000
-1.000000 -1.000000 -1.000000 -1.000000 0.000000 -0.000000
-1.000000 -1.000000 1.000000 -1.000000 0.000000 -0.000000
-1.000000 1.000000 1.000000 -1.000000 0.000000 -0.000000
1.000000 0.999999 1.000000 0.000000 1.000000 0.000000
1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000
-1.000000 1.000000 -1.000000 0.000000 1.000000 0.000000
-1.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000
0.999999 -1.000001 1.000000 -0.000000 0.000000 1.000000
1.000000 -1.000000 -1.000000 1.000000 0.000000 0.000000
1.000000 1.000000 -1.000000 1.000000 0.000000 0.000000
0.999999 -1.000001 1.000000 1.000000 0.000000 0.000000
-1.000000 -1.000000 -1.000000 -0.000000 -1.000000 0.000000
-1.000000 1.000000 -1.000000 -1.000000 0.000000 -0.000000
-1.000000 1.000000 1.000000 0.000000 1.000000 0.000000
3 0 1 2
3 3 4 5
3 6 7 8
3 9 10 11
3 12 13 14
3 15 16 17
3 18 0 2
3 19 3 5
3 20 21 22
3 23 9 11
3 24 12 14
3 25 15 17

GL_TRIANGLE_FAN在这里是错误的原语-一个三角形扇有一个固定顶点,所有三角形共享。如果你只有三角形,GL_三角形是更好的选择。如果不是,考虑三角测量,或者以其他方式建立三角形条带。< /P>