I am using OpenGL with the Python bindings. I am passing my faces to OpenGL with the following code:
glBegin(GL_TRIANGLES)
for i in range(len(triangles)):
glVertex3fv(triangles[i])
glEnd()
where triangles
is a list of faces.
This part of the code seems to be rather slow, taking on the order of a few seconds for a mesh of ~10,000 faces. Is there a simple way to speed it up, perhaps passing across all the triangles at once instead of using this for loop?