[PyOpenGL-Users] Request for help for updating OpenGL view
Brought to you by:
mcfletch
From: Douglas S. B. <db...@br...> - 2003-01-24 01:56:47
|
PyOpenGL-users, I was wondering if someone could point me to some example code, or give me some hints. Here's what I need to do: I have a GUI that has one Python thread updating some values (a robot's sensors actually), and I'd like to have an OpenGL view of the robot updated as often as possible without stressing the computer too much. The OpenGL should draw the robot and sensors, but also allow rotating/zooming/etc the view of the robot via the mouse, or programmatically. I have a hacky version working that uses the do_AutoSpin method, but sets xspin and yspin to 0 so that it doesn't really spin it, but it does update the window: def refresh(self): self.win.autospin = 1 self.win.xspin = 0 self.win.yspin = 0 self.win.after(500, self.win.do_AutoSpin) Besides being hacky, this has some problems: 1. it uses about 98% of a CPU 2. If you change the view (rotate/zoom the robot) in the OpenGL window, you have to run the above refresh() method again Can any help point me to the proper way of having this functionality? Thanks in advance! -Doug -- Douglas S. Blank, Assistant Professor db...@br..., (610)526-6501 Bryn Mawr College, Computer Science Program 101 North Merion Ave, Park Science Building Bryn Mawr, PA 19010 dangermouse.brynmawr.edu |