Re: [PyOpenGL-Users] Modelview and projection matrices
Brought to you by:
mcfletch
|
From: Jan E. <ch...@in...> - 2002-01-06 12:59:32
|
On Sun, 6 Jan 2002, Richard Jones wrote: >Code (interchangeable python and C modules for frustum culling and octree >storage) attached :) Wow. This was a little bit more than I was asking for, but I humbly bow and will try to use your code. :) Thanks a lot for the code. Hmm, I tested your code now, and I don't get it. Nothing is inside the frustum, all points I give it are outside. Strange. maybe gluLookAt() is pure evil wrt these kinds of operations. I'll try to dig some more. >You can also get this code by downloading the tarball from >http://goanna.adroit.net/~richard/ufo/ where there is some octree code that >uses the frustum culling too. Note that since I discovered that the code is >_significantly_ faster when it just draws _everything_ rather than tries to >cull, the current ufo.py doesn't actually call the frustum or octree code. In >a nutshell, define objects like the triangle object, stuff them into the >octree with octree.insertPolygon or octree.insertObject for each of the >object's bounding vertexes. The call octree.render with the frustum and it >calls each of the appropriate sub-object's render() method. Ok. I was thinking about some kind of simplified octree myself, or mainly just do divide the terrain into, say, 16 pieces (4x4) and just cull those pieces. Should not be too much Python code each frame. >Note that I do _all_ my view projection manipulation in the projection >matrix, so I don't include the modelview matrix. It's simple enough to >un-comment the appropriate code though. I assume you mean the line: self.c = c = p * m -- Real stupidity beats artificial intelligence every time. -- Terry Pratchett, Hogfather |