[PyQt] Basic 3D Viewer

Arne Schmitz arne.schmitz at gmx.net
Tue May 31 09:41:21 BST 2011


Am 30.05.2011 um 21:04 schrieb Knacktus:

> I need to evaluate the options for building a basic 3D viewer with PyQt. The scenes are static, but quite large (some hundreds medium complex (~500 triangles) objects). Show/Hide objects, rotate, drag, zoom, change colors and some other basic operations need to be available.

Does it have to be Python? Our lab has developed a 3D mesh processing tool / framework called OpenFlipper: http://www.openflipper.org/ 

It is based on C++ and Qt. You can easily write new plugins to do arbitrary stuff, using C++. Scripting is done via Qt's JavaScript implementation.

Would be nice to have Python bindings, though... :)

> Currently, I've got some very coarse understanding of OpenGL and scenegraphs, but cannot really grasp the complexitiy of the topic.

This /can/ become arbitrarily complex, but you can start out simple. Getting efficient might be a problem.

> Can anyone comment on the complexity of building it from scratch? I'm looking for some directions, best practices. E.g., do PyOpenGL and PyQt play together?

They do. I wrote a minimal 3D viewer using both: https://github.com/root42/PyGLWidget

It gives you a PyQt based window and a PyOpenGL context. Zoom, translate and rotate via mouse are already implemented. Nothing more, nothing less. I use the widget for small programs where I want to render some simple stuff.

Best regards,

Arne

-- 
Dipl.-Inform. Arne Schmitz              Phone   +49 (0)241 80-21817
Computer Graphics Group                 Mobile  +49 (0)151 29145947
RWTH Aachen University                  Fax     +49 (0)241 80-22899
Ahornstrasse 55, 52074 Aachen, Germany  http://www.rwth-graphics.de



More information about the PyQt mailing list