VPython overview

Why use VPython?

Python

Python is a powerful object-oriented programming language initiated by Guido van Rossum in 1990. It is easy to start writing simple programs in Python, and even using classes and objects involves a relatively gentle learning curve. Python is cross-platform (Windows, Mac, Linux). It is open source (and free) and supported by a sizable developer community. Python is a general-purpose programming language with significant numerical capabilities, though a common use of Python is managing servers, administering systems, etc. See the extensive web site, www.python.org. There are various good textbooks available, as well as tutorials available on the web.

Realtime 3D Graphics: Visual

Python itself does not provide graphics output. The Tk graphics library can be used to create 2D graphics, but it is difficult to use. In the spring of 2000, while a sophomore in computer science at Carnegie Mellon University, David Scherer created a 3D graphics module for Python, called "Visual," that is exceptionally easy to use. A program can create 3D objects (such as spheres, curves, etc.) and position them in 3D space. Visual, running in a separate thread, automatically updates a 3D scene many times per second, to reflect the current positions of the objects. The programmer does not need to deal with display management, but can focus on the computational aspects of the program. The user can navigate in the 3D scene by using the mouse to zoom and rotate while the program is running. Visual supports full vector algebra.

The combination of Python plus the Visual module is called "VPython". (Visual is dependent on an existing Numeric module, now superceded by Numpy.)

Use in Classrooms

Students in introductory physics courses have been using VPython to do computer modeling. VPython lets students focus on the physics computations without having to write explicit graphics statements yet obtain 3D visualization. Students can do true vector computations, which improves their understanding of the utility of vectors and vector notation.

Platforms Supported

The Python language itself is cross-platform. The Visual module, and the Idle integrated development environment, work with Python on Windows and Unix/Linux/MacOSX.

Contributors

The original implementation in the spring of 2000 was carried out by a team at Carnegie Mellon University led by David Scherer. Scherer did almost all of the coding, but he was aided in various ways by David Andersen, Ruth Chabay, Ari Heitner, Ian Peters, and Bruce Sherwood.

Jonathan Brandmeyer while an undergraduate student at North Carolina State University created an auto-configured installer that made it much easier to install the Visual module on many flavors of Linux systems. He also made two other major contributions: a major change to the architecture to use Boost libraries rather than CXX for connecting between C++ and Python, and major enhancements to support transparency, surface textures, and sophisticated lighting.

Others who have contributed significant code to the Visual module include Shawn Press, Hugh Fisher, John Zelle, Arthur Siegel, and Michael Temkhine. See "Recent developments" for details.

Published Articles

A journal article about VPython has been published:

Scherer, D., Dubois, P., & Sherwood, B. (2000). VPython: 3D Interactive Scientific Graphics for Students, Computing in Science and Engineering, Sept./Oct. 2000, 82-88.