[PyOpenGL-Users] How to select an object
Brought to you by:
mcfletch
From: duncan d. <dun...@gm...> - 2007-11-13 16:58:02
|
Hello I am playing with python and pyopengl. I have not any problem to draw the object and so on, but then I'd like to select an already drawn object. The code is attached Running it I get this error: --------- pick3d ---------- - nhits = 0 hit nothing - selectedObjects: Traceback (most recent call last): File "C:\software_personale\openboat\code_snippets\hellogl.py", line 143, in mouseReleaseEvent self.pick3d(event) File "C:\software_personale\openboat\code_snippets\hellogl.py", line 257, in pick3d return self.processBuffer() File "C:\software_personale\openboat\code_snippets\hellogl.py", line 274, in processBuffer print " - selectedObjects: ", self.selected AttributeError: selected As you can see, the function is called in the mouseReleaseEvent (O also tried the mousePressEvent) Any idea (or link) on how I can select an object ? My goal is to be able to select a point and drag it around the viewport, beeing able to get the new position Any hints ? thanks in advance bye Gianluca |