This code was created by Richard Campbell '99 and ported to Python/PyOpenGL by John Ferguson and Tony Colston 2000.
More...
This code was created by Richard Campbell '99 and ported to Python/PyOpenGL by John Ferguson and Tony Colston 2000.
To be honest I stole all of John Ferguson's code and just added the changed stuff for lesson 5. So he did most of the hard work.
The port was based on the PyOpenGL tutorial module: dots.py
If you've found this code useful, please let me know (email John Ferguson at hakui.nosp@m.n@vo.nosp@m.icene.nosp@m.t.co.nosp@m.m). or Tony Colston (tonet.nosp@m.hema.nosp@m.n@hot.nosp@m.mail.nosp@m..com)
See original source and C based tutorial at http:#nehe.gamedev.net
Note:
This code is not a good example of Python and using OO techniques. It is a simple and direct exposition of how to use the Open GL API in Python via the PyOpenGL package. It also uses GLUT, which in my opinion is a high quality library in that it makes my work simpler. Due to using these APIs, this code is more like a C program using function based programming (which Python is in fact based upon, note the use of closures and lambda) than a "good" OO program.
To run this code get and install OpenGL, GLUT, PyOpenGL (see http:#www.python.org), and NumPy. Installing PyNumeric means having a C compiler that is configured properly, or so I found. For Win32 this assumes VC++, I poked through the setup.py for Numeric, and chased through disutils code and noticed what seemed to be hard coded preferences for VC++ in the case of a Win32 OS. However, I am new to Python and know little about disutils, so I may just be not using it right.
NumPy is not a hard requirement, as I am led to believe (based on skimming PyOpenGL sources) that PyOpenGL could run without it. However preformance may be impacted since NumPy provides an efficient multi-dimensional array type and a linear algebra library.
BTW, since this is Python make sure you use tabs or spaces to indent, I had numerous problems since I was using editors that were not sensitive to Python.
Ported to PyOpenGL 2.0 by Tarn Weisner Burton 10May2001