Getting started on opengl/pyopengl and wxpython

could someone suggest how to start about using pyopengl/opengl with wxpython.I have no prior experience of opengl/pyopengl,though i have used vpython.

Short answer: it’s really about the same as using OpenGL from C or any other lower-level language. In fact, some of the Python code will end up looking identical to the C version, minus semicolons.

The wxPython demo will show you how to set up the window. That still leaves user interaction; here is a more complex example with mouse controls for viewing (somewhat outdated with respect to the wxPython API, but easily converted):

http://web.archive.org/web/20050623014950/http://lists.wxwidgets.org/archive/wxPython-users/msg11078.html

Once you have those elements in place, everything else is pretty much just straight OpenGL and you can use any examples/books you want as a basis for learning. Not all features are supported in the wxGLCanvas - antialiasing, for instance, will not be available until version 2.9 at least.

Depending on what you want to use OpenGL for, I would strongly recommend looking at VTK instead - it is a much higher-level API primarily for scientific/engineering visualization. I haven’t actually used it myself, but OpenGL is hideous, and wrapping it in Python doesn’t make it any less so. If you know some linear algebra it may be less painful for you, but it really is a very minimal library.

···

On Fri, Sep 11, 2009 at 6:59 PM, nipun batra nipunreddevil@gmail.com wrote:

could someone suggest how to start about using pyopengl/opengl with wxpython.I have no prior experience of opengl/pyopengl,though i have used vpython.