[PYTHON MATRIX-SIG] Python OpenGL Module and NumPy

Kevin Rodgers (x39079, WT-07) rodgers@vs.lmco.com
Fri, 02 May 1997 10:46:33 -0500


(I'm crossposting to both the main list and the matrix-sig because I'm not 
sure where this best fits)

I'm using the OpenGL module to do a flight simulation program, and have run 
into a situation where I'm confused about the integration of NumPy and the 
OpenGL module.  I'd like to read in a vehicle definition that may consist of 
hundreds of polygons, each with potentially hundreds of vertices, then render 
these with OpenGL.  This seems like a natural integration of PyOpenGL and 
NumPy; for each polygon, you could pass a Numeric array of dimension (3,nPoly) 
where nPoly is the number of polygons and 3 is the number of coordinates per 
vertex; the C implementation of PyOpenGL would then call gl_Vertex3* as 
appropriate.  This would obviously be much faster than writing the calls to 
gl.Vertex3* as a loop in Python.  I've looked through the source to PyOpenGL, 
though, and it appears that only the gl.ColorVertex2 function actually 
implements this.  Am I correct?  If not, then how does one use Numeric with 
PyOpenGL?  If I am correct, has anyone implemented the functionality I want, 
or should I bite the bullet and do it myself?  Thanks in advance for any help.
-- 
Kevin Rodgers    Lockheed Martin Vought Systems    rodgers@vs.lmco.com
"This one goes up to eleven."  --  Nigel Tufnel
-------------------------------------------------------------------------------



_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________