papillon68 opened this issue on Sep 25, 2010 · 5 posts
papillon68 posted Sat, 25 September 2010 at 12:28 PM
I'd like to ask if picking is possible using wxPython: I would like, for example, to run a python script that return the xyz coordinate of a point in 3d space.
So for instance, if you click on the Poser ground prop, or a figure, it would return the coordinates of that point (pixel) you clicked on.
Thanks
visit my
blog: www.alessandromastronardi.com
My
Rendo Store
semidieu posted Sun, 26 September 2010 at 6:38 AM
I don't thnk it's possible directly...
You can detect that an actor has been changed and you could get it's xyz space corrdinate (the 'zero' point of the actor). But you can't get the pixel directly.
nruddock posted Sun, 26 September 2010 at 12:23 PM
Poser only provides the opposite conversion (World -> Screen).
You can't do it without access to information from OpenGL, specifically the perspective transform matrix.
While it is possible to get access to the underlying OpenGL stuff by installing extra Python modules, doing OpenGL picking requires a fair amount of understanding and work (and you'll still have to write code to resolve hits into polygons/actors).
papillon68 posted Sun, 26 September 2010 at 12:55 PM
I have some experience with opengl programming (being coding flight simulators for a while, long time ago: http://www.simulationfreaks.com/), so I would know how to do that. Unfortunately, as you confirmed, poser opengl environment is not accessible. Thanks anyway to clarify that
visit my
blog: www.alessandromastronardi.com
My
Rendo Store
nruddock posted Sun, 26 September 2010 at 2:08 PM
Quote - Unfortunately, as you confirmed, poser opengl environment is not accessible.
In P8 it is if you install a wrapper module and hook into the canvas via wxPython.
If it's just for your own use, then you'll either mange it or not, but if it was intended for others to use, then it probably wouldn't be worth the support effort.