[PyOpenGL-Users] openglcontext 2.0 problem
Brought to you by:
mcfletch
From: gabor <ga...@re...> - 2003-02-01 10:34:59
|
hi, 1. i've created a simple app using testcontext. my render method looks like this: def Render(self, mode = 0): BaseContext.Render(self,mode) glDisable(GL_CULL_FACE) t = time.time() for trilist in self.tris: glVertexPointerd(trilist ) glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_TRIANGLES, 0,len(trilist)) t = time.time() -t print "renderTime",t * 1000.0,"milliseconds" i'm rendering around 1500-2000 wireframe triangles this way, and it's too slow... i got renderTime around 37 miliseconds..., that means around 30fps... if i do it with the gl functions commented out i got aroun 0.007 miliseconds... does that rendering take so long? then i replaced that glVertexpointer code with: glBegin(GL_TRIANGLES) for v in trilist: glVertex3f(v[0],v[1],v[2]) glEnd() and it renders in around 28 miliseconds... it's faster ?!?!?!?!?!?! what am i doing wrong? 2. a have meshes defined as list of triangles... i need to do be able to pick a triangle of it with the mouse... in the past i used glUnproject to get the mouse coords, and then doing the intersection math... is there something on OpenGLContext2 that i could use for this? thanks, gabor |