Home

Documentation

Download:
   Windows
   Macintosh
   Linux

New in VPython 6

Change log

User forum

Contributed programs

For developers

Python web site

 

Overview

What is VPython?

proton orbit

The Python Programming Language

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

This is documentation for Classic VPython (VPython 6), which continues to be available but is no longer supported. See vpython.org for information on installing VPython 7 or using GlowScript VPython. Documentation is available at glowscript.org by clicking Help.

Python itself does not provide graphics output. The Tk graphics library can be used to create 2D graphics, but it is aimed at very experienced programmers and does not support 3D displays.

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 also dependent on a numerical array module, numpy.

Use in Education

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. Instructors have used VPython to create 3D lecture demo programs.

Use in Research

Python is widely used in scientific research (see scipy.org). VPython has been found useful in research for visualizing situations and data in 3D.

Platforms Supported

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

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.

Visual 5 was created by David Scherer and Bruce Sherwood. Jonathan Brandmeyer provided support in Visual 4beta for opacity, local lighting, and textures, and made some important architectural changes, but had to stop work on the project before it was completed.  Further development has led to API changes which are incompatible with the Visual 4beta release, so the new release is called version 5 instead of 4.

The late Arthur Siegel implemented dependence on the currently supported numpy library in place of Numeric, which is no longer supported. Hugh Fisher provided a big start on the native-mode Mac version. Michael Temkine fixed some bugs and implemented keyboard handling for Windows.

Previous to Visual 4beta, Jonathan Brandmeyer made several major contributions to Visual 3, including changing the connection between Python and C++ from CXX, which was no longer supported, to the Boost C++ libraries, and implementing auto-configurable installations for Linux.

Others who have contributed significant code to the Visual module include Shawn Press and John Zelle. 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.