Re: [PyOpenGL-Users] wxPython + PyOpenGL examples?
Brought to you by:
mcfletch
From: altern <en...@al...> - 2005-04-02 22:40:47
|
hi michael Michael Urashka wrote: > I've also cross-posted this to the wxPython list, since I wasn't sure > which would be more appropriate. > > I've been using wxPython for a little while now and have at least the > ability to made basic applications with it. > > For a new project however, I'm thinking of using wxPython and PyOpenGL > for some (primarily) 2D GUI stuff. Basically needing a frame, menu, a few > buttons, a listctrl (or grid) and maybe a few other basic things. > > Also I will need a drawing area that can zoom, scroll/clip a large > drawing area and have drawn objects selected. This is key. There is the > need to be able to kick off a function say when a particular object is clicked. > > It looks like OGL could likey do this but it also appears to be > deprecated. There's the need for this application to be around for > another 5-10 years and hence needs to be maintainable so I thought I would > go for standard or at least open source tools. It might get rewritten in > C/C++ with wxWidgets, OpenGL in the future, but I'm not 100% certain so it > would also be nice if the code wasn't too difficult for someone to port > if necessary. > > I know wxPython has the GLCanvas widget which is probably a good start. > > I have the OpenGL Red Book on my desk even as I write this. > > Primarily I'm looking for some good, clear, simply examples of using > wxPython + PyOpenGL. I have come across only a few examples on the web and > certainly haven't seen any large, clear tutorials or texts on the subject > though I haven't subscribed to the PyOpenGL list, perhaps I should > cross-post it there. I've seen a couple straight up PyOpenGL examples > but they tend to make use of PyOpenGL's bundled Tk stuff... I was also looking for examples of this and i found really hard to find any. Did you find any good Tk based examples? > So I was wondering if anyone has any short, simple code in wxPython 2.5 > for doing basic 2D OpenGL work, like: > > - making a wx.frame or panel > - embedding a GLCanvas > - drawing a couple simple objects (square, circle, doesn't really matter) > - selecting those objects with the mouse and having the event captured > so can execute a function in response to that click? > > Any advice would be most appreciated, emailed or to the list. there is an example on the wxpython documentation. This might also help, but i am not sure it is very right. http://www.ixi-software.net/workshops/uiah05/python/wx_opengl.py If you are just interested on simple 2D graphics you might find this useful, we are working now on it and it comes with a GLUT example but it can also be used in wxpython. http://www.ixi-software.net/content/download/simpleosc0.1.1.zip It is still very early in the development though. We are aimed to do exactly what you describe in this last list, and it is kind of working but it is not very good code, just a prototype, we are trying now to organise it in a sensible way with the help of a Java game programmer who kindly has offer his help. But as i said it the example that comes with it is based on GLUT, if you really need it i could send you the wxpython prototype but it is currently under construction so it might not work very well best -- enrike |