[PyOpenGL-Users] Zipping and rendering numpy arrays
Brought to you by:
mcfletch
From: Martin B. <bl...@fu...> - 2007-05-30 01:49:30
|
Hi I have 2 or 3 long numpy arrays to send to the vertex pipeline. This is actually most of my rendering time. Here is what I do in Python: def gliVertexArrays(a1, a2, a3=None): """ Zip and output the given numpy arrays of floats through the GL vertex pipeline. """ if a3 is None: list(starmap(glVertex2f, izip(a1, a2))) else: list(starmap(glVertex3f, izip(a1, a2, a3))) Is there a C function that does this? I saw glVertexPointer, but it seems I would have to create a temporary array that would contain both my arrays just to call this function. I'd rather avoid the memory allocation and zip-loop in C. This seems pretty basic and reasonable to me... is it already in PyOpenGL? If not, is there another way I'm not thinking of? Any idea welcome. cheers, |