0

I would like to develop a python application to import an obj file and then allow the user to interact with it, moving the loaded objects (including the roll and span movements). Furthermore, when the user clicks on an area of the model, the application will be able to take the 3D mouse coordinates. Any suggestion about how to obtain mouse coordinates (x,y,z)?

UPDATE this is the example code : pastebin.com/FxGczBEt I would like to print the x,y,z mouse coordinates instead of x,y only ("OnMouseDown" function)... I haven't found anything useful in the wx-python library...

Gekk0r
  • 13
  • 2
  • What have you tried so far? Do you have any specific coding questions? Posting examples of what you have tried coding would improve your answer. – Richard Erickson Jul 30 '15 at 15:49
  • So the xyz of the intersection of the line under the mouse and the foremost object? – Rasmus Damgaard Nielsen Jul 30 '15 at 15:50
  • this is the example code : http://pastebin.com/FxGczBEt I would like to print the x,y,z mouse coordinates instead of x,y only ("OnMouseDown" function)... I haven't found anything useful in the wx-python library – Gekk0r Jul 30 '15 at 19:42

1 Answers1

1

Have you looked at Panda3d? I am working on a wx app that controls a scene rendered in Panda3d (in another word it's a panda3d app with wx for GUI).

You can call the wxpython event loop from Panda3d side as mentioned here. https://www.panda3d.org/manual/index.php/Main_Loop

In Panda3d, picking a model by mouse clicking seems like an easy task (collision with ray casting). https://www.panda3d.org/manual/index.php/Clicking_on_3D_Objects

I know it's not a direct answer to your question but I just wanted to point out that mixing wxPython and Panda3d works so well.

otterb
  • 2,660
  • 2
  • 29
  • 48