我正在尝试用 . 填充由 4 行生成的四边形GL_LINES
。但是,当我尝试填充四边形时,它只填充三角形。这是绘制线条的代码:
def SurfaceContour(self, vertices, edges):
glBegin(GL_LINES)
for edge in edges:
for vertex in edge:
glColor3fv((1.0, 0.0, 0.0))
glVertex3fv(vertices[vertex])
glEnd()
这是绘制填充四边形的代码:
def Surfaces(self, vertices):
glBegin(GL_QUADS)
for i in range(4):
glColor4f(1, 1, 1, 0.3)
glVertex3fv(vertices[i ,:])
glEnd()
这是我传入的顶点矩阵:
[[ 0. -20.23 7. ]
[ 0. -20.23 -7. ]
[ 100. -10. 5. ]
[ 100. -10. -5. ]]