我的问题是,我的程序只显示一个简单的立方体,帧速率限制为120fps,但实际运行只有25fps。我发现所有性能损失都在OpenGL部分,但我无法确定具体是哪里出了问题。
我的问题是:
我的问题是:
- OpenGL在Python中运行得这么慢是正常的吗?
- 我的旧笔记本电脑是否是问题的一部分?
def draw(self):
glBegin(GL_QUADS)#info for OGL: treat following code as surface drawing code
for surface in self.surfaces:
x = 0
for vertex in surface:
x+=1
glColor3fv(self.colors[x])
glVertex3fv(self.verticles[vertex])
glEnd()
glBegin(GL_LINES) #info for OGL: treat following code as line drawing code
for edge in self.edges:
for vertex in edge:
glVertex3fv(self.verticles[vertex]) #pass each verticle in the verticles list to glVertex3fv, which creates edges
glEnd() #info for OGL:no more code incoming