[wxPython] wxPython OpenGL demonstration with navigation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] wxPython OpenGL demonstration with navigation

Mike  Fletcher
I've attached two modules, one is an simple "viewing platform" object.  The
other is a demonstration of using this platform with wxPython's OpenGL
panel.

The demonstration requires both PyOpenGL and Numeric python. This is not a
great approach, but I haven't the time to figure out how to eliminate it
(likely would be fairly easy by using OpenGL's matrix multiplication instead
of numeric's, I just haven't tried).

The demonstration shows a "flying" algorithm, which allows you to explore
the virtual environment using your keyboard arrow keys.  If you hold down
the Ctrl key, you enter "looking around" mode, which allows you to rotate
your "head" with the arrow keys, and thereby change your direction of
motion.  If you hold the shift key down while flying, you will move faster.
The "-" key allows you to "straighten", i.e. return to an upright and locked
position.

The wxPython work here is really quite trivial.  Nor is this much of a start
at the generalised browser, but Robin asked for a demo, not an application
:) .

Incidentally, the demo also maintains "object aspect ratio", that is,
objects do not deform when the frame is resized.

Enjoy,
Mike
__________________________________
 Mike C. Fletcher
 Designer, VR Plumber
 http://members.home.com/mcfletch


glpanel.py (5K) Download Attachment
viewplatform.py (2K) Download Attachment