[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] is fast opengl a possibility in pygame?



On 8/25/05, Jasper <jasper@xxxxxxxx> wrote:
> Rene Dudfield wrote:
> 
> > Another thing which is faster... believe it or not... is to use
> >
> >translate/rotate calls instead of pushing and popping the matrix.
> >
> >glTranslatef(gx,gy,gz)
> >glRotatef(grot, grx ,gry ,grz)
> >drawBOB();
> >glRotatef(grot, -grx ,-gry ,-grz)
> >glTranslatef(-gx,-gy,-gz)
> >
> >
> I too found my code was faster after I pulled out Push/Pop Matrices
> (simpler too).  Such manipulations turned out to be more expensive than
> I expected at first glance; I didn't run any serious time tests (I was
> happy just that the code was simpler), but it sure felt like it was
> taking longer than setting and reading 16 floats should.

Hmm. This is very interesting. I never suspected that PushMatrix and
PopMatrix could be a source of slowdowns. I'll have to test the above
trick in my own opengl code.

However, isn't the above version prone to accumulating floating point
inaccuracies?

-- 
Sami Hangaslammi