In this recipe, we will create our own GUI using wxPython. We will reuse some code from the wxPython demo examples, which we have reduced to the minimum code required to display OpenGL
in 3D.
Note
OpenGL
is a very large library. We will not go into detailed explanations of this library. There are a lot of books and online documentation available if you want to study OpenGL
further. It has its own shading language.
As the entire Python code is a little bit long here, we will show just a little bit of the code.
The entire code is available online and this Python module is called wxPython_OpenGL_GUI.py
:
import wx from wx import glcanvas from OpenGL.GL import * from OpenGL.GLUT import * #--------------------------------------------------- class CanvasBase(glcanvas.GLCanvas): def __init__(self, parent): glcanvas.GLCanvas.__init__(self, parent, ...