Grafica 3D con OpenGL su Python

Abstract

The talk will start with a brief introduction to OpenGL, a standard cross platform API used to access 3D functions on graphic adapters.

After showing some basic examples of Python and OpenGL integration using the stable and widespread PyOpenGL binding, advantages and disadvantages of interfacing to OpenGL exclusively from Python will be highlighted.

Together with discussing prototyping ease and integration with the NumPy package with such an approach, possible solutions to limit performance penalties against a drawing loop written with a compilable language will be presented, using display lists, vertex arrays, vertex buffer objects.

An overview of how to access OpenGL Extensions from Python will follow, not only standard ones like ARB and EXT but vendor-specific too like NV and ATI. In this same context, possibility to use the GL Shading Language to access programmable units in modern graphics adapters will be presented.

The talk will go on explaining how to write part of the drawing loop in C, and how to write a Python extension from that code using the sip tool.

After an overview of the future of OpenGL for Python, of the architectural choices behind PyOpenGL 3.x, and alternative bindings like pyglet, problems one would encounter writing a almost-zero-overhead OpenGL Python wrapper will be presented, along with two prototype implementations, one based on sip, the other on cython.

Video