A time line for VPython development

Here is a time line for the development of VPython, an extension to the Python programming language that makes it unusually easy to generate navigable real-time 3D animations (vpython.org).

1997: While at Carnegie Mellon, after writing a volume on introductory electricity and magnetism, Ruth Chabay and I teach introductory “modern mechanics” for the first time, including having the students program computational models, using the cT language I had created, something a bit like a good Basic, with (2D) graphics built-in, but running in a windowing environment on Unix workstations, Macintosh, and Windows (cT overview). cT was based on the TUTOR language of the PLATO computer-based education system (see my home page for links to videos of a conference about the history of the PLATO system).

1998: We have a remarkable student in our mechanics class, David Scherer. While in high school he led a team of his friends to create a 3D game that later won a national prize. He’s intrigued that cT has allowed students to write computational models that work on all platforms, but he glimpses a more powerful approach that would support 3D.

2000: We abandon cT, and in the spring Scherer creates VPython, with Ruth and me deeply involved in design and testing. Many powerful programmers have no interest in or patience for novice programmers, but Scherer saw it as an interesting challenge how to make programmatic 3D animations accessible to novices. His answer is to make real-time navigable 3D animations a side effect of computations, lifting a huge task from the shoulders of the novice. Of course this is also a huge benefit to sophisticated programmers as well. The original version of VPython is now called “Classic” VPython. It requires installing Python, the “visual” module, and an improved program editor based on the IDLE editor that comes with Python. In the fall of 2000 we start having students use VPython to do computational modeling in our course.

2002-2006: Jonathan Brandmeyer, an engineering student at North Carolina State University where Ruth and I were teaching, makes major contributions to VPython 3. He introduces the use of the C++ Boost libraries to glue the core of VPython, implemented in threaded C++ code, to those components written in Python, and builds autoconfigurable installers for Linux. In the 19 year history of VPython only three people made major contributions to the complex C++ code, Scherer, Brandmeyer, and me.

2008: Scherer, having sold his first software company and thinking about what to do next, and I work on VPython 5. Jonathan Brandmeyer provided support in VPython 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 led to API changes that were incompatible with the VPython 4beta release, so there was no version 4.

2011: Kadir Haldenbilen, a retired IBM engineer in Turkey, and I collaborate to create the 3D text object and the extrusion object for VPython 5.

2011: Ruth and I learn about WebGL from very knowledgeable computer colleagues in Santa Fe, New Mexico. WebGL is a 3D library built into modern browsers. I poke at it and see that it is quite difficult to use, like its big sister OpenGL used by Classic VPython, but I realize that the VPython API provides a model for making WebGL accessible to novices. I mock up a demo and show it to Scherer, who at the time was CEO of his second major software company. He’s intrigued and in a couple of months puts together the glowscript.org site (it’s a Google App Engine application), solves the problems of operator overloading (to permit adding vectors A and B as A+B) and synchronous code (such as perpetual loops), neither of which was native to JavaScript. He does all this as a project where he can see progress, as relief from his work at FoundationDB where the extreme difficulty of solving once and for all the problems of distributed databases has been getting him frustrated. After setting up GlowScript in just two months he leaves, and since then I’ve been developing GlowScript. GlowScript programs were written in JavaScript, as are the GlowScript libraries.

2013: Release of VPython 6, based on wxPython, which was initiated by me in June 2012 to address the serious problem that the Carbon programming framework for the Mac will no longer be supported. Major contributions to the release were made by Steve Spicklemire, a physics professor at the University of Indianapolis.

Late 2014: Thanks to learning from Salvatore di Dio, a programmer in France, about the RapydScript Python-to-JavaScript transpiler, I’m able to make it possible for GlowScript users to write their programs using the VPython API, somewhat modified due to the very different environment (browser, GPU). It is also around this time that John Coady, a programmer in Vancouver, implements the Classic VPython API in pure Python, in the IPython environment, in which your Python program runs on a local server and sends data to your browser, where his JavaScript program acts on the data to display the 3D animation in a Jupyter notebook cell (the Jupyter notebook in the browser is similar to a Mathematica or Sage notebook). He uses the GlowScript libraries to render the 3D images. The advantage of this Jupyter implementation in comparison with GlowScript VPython is that you’re writing real Python, not the necessarily imperfect RapydScript representation of Python, and you have access to the large universe of Python modules, which are not accessible from within a JavaScript-based browser.

Fall 2015: Some institutions using our textbook, including Georgia Tech, report switching from Classic VPython to GlowScript VPython, and note with surprise how much more enthusiastic students are about using VPython now that they don’t have to install anything. In contrast, Classic VPython required the installation of Python, the installation of the visual module, and, on the Mac, installation of an update to Tcl. This can be daunting and can fail for non-obvious reasons. Moreover, you need to know about folders and files and file extensions. The use of GlowScript VPython rises rapidly; here is a graph of usage vs. time.

January 2016: Coady, Ruth and I, and several well-known physics education colleagues (all of them users of our textbook and of VPython) publish a document on the further evolution of VPython, in which we announce abandonment of the 16-year-old Classic VPython in favor of the GlowScript and Jupyter versions. Here is that document, detailing our reasons.

January-September 2016: In collaboration with Coady, Ruth and I modify and complete Jupyter VPython to use the GlowScript VPython API instead of the Classic API that Coady had started with, because it is much better suited to the distributed nature of the Jupyter environment. Steve Spicklemire and Matthew Craig, a physics professor at Minnesota State University Moorhead, contribute mechanisms for creating pip and conda installers. Here are demo programs running in Jupyter notebooks.

July 2016: The 3D text object is implemented in GlowScript, with major contributions from Kadir Haldenbilen. I complete the GlowScript implementation of the extrusion object, though it is still missing some capabilities that were present in Classic VPython (I later implemented the missing capabilities).

January 2017: Switch from the original RapydScript to RapydScript-NG, which is more suitable for transpiling VPython to JavaScript.

February 2017: I make the 3D text object and extrusion object available in Jupyter VPython.

June 2017: In response to requests from users, I release a version of the Python module vpython that can run outside the Jupyter notebook environment. The module detects whether the program is running in the notebook, and if not, it sets up http and websocket server mechanisms that display the 3D animations in a browser page. This makes it possible to work in IDLE or Spyder or other environment that can launch Python programs. I thank John Coady for providing helpful advice, Matt Craig for new installers, and Ruth Chabay for useful discussions. We now call VPython used with installed Python “VPython 7”.

May 2018: I release the offline version of GlowScript VPython. It is a browser package with no server; you doubleclick an html file that invokes JavaScript code which includes a text editor based on the html textarea object.

February 2019: Matt Craig carries out a major restructuring of the code base of VPython 7 and, with the help of John Coady, enables use with Jupyterlab and current Spyder. From that time forward Matt assumes major responsibility for keeping VPython 7 installers up to date.

September 2019: The Streamline library had been used to transform synchronous code such as infinite loops into the asynchronous form required by JavaScript. I release GlowScript VPython 2.9 that uses the relatively new JavaScript features “async” and “await” instead of Streamline. Compilation from Python to JavaScript now takes 1/6th the time previously needed with Streamline, which had to do a huge amount of work to achieve the same effects.

2020-2021: During this period many new features were implemented, such as attach_light. There was also a lot of work involved in updating the code that precedes and follows the call to RapydScript-NG, to insert async and await where needed in user programs.

January 2021: Steve Spicklemire makes major changes to use Python 3 rather than Python 2 in the server component of the Google App Engine, which deals with storing and retrieving user programs.

June 2022: The name “GlowScript VPython” is changed to “Web VPython” to emphasize its use in the browser and to make it clearer what the difference is between the browser-based version and VPython 7, which is based on installed Python. The JavaScript libraries used by both versions continue to be referred to as the Glowscript libraries. It is now the case that navigating to webvpython.org takes you to glowscript.org.

Here is a description of the architecture of Web VPython and VPython 7.

Bruce Sherwood

This entry was posted in Uncategorized. Bookmark the permalink.

13 Responses to A time line for VPython development

  1. Wil says:

    Dear Bruce,
    Is there the possibility of inserting Vpython 7 inside a WxPython GUI (without browser)?
    Thanks in advance
    Best regards

    • BruceSherwood says:

      I don’t see how. The browser element is essential, because the rendering of the 3D scene is based on GPU use of WebGL, the version of OpenGL that is built into modern browsers. You could create a WxPython GUI that includes, say, a button which when clicked would start or stop a VPython animation, but the GUI and the 3D animation would appear in different windows. Note that VPython 7 does have a significant set of widgets built-in: button, radio, checkbox, slider, menu, and wtext:

      http://www.glowscript.org/docs/VPythonDocs/controls.html

      • Wil says:

        Hello Bruce,

        I think of the following: Generate a mini web browser inside from a Wxpython frame and to show the 3D graphic there.
        It’s possible?

        Note: Sorry, my english isn’t good

        Thank You in advance
        Best regards

        • BruceSherwood says:

          Sorry, but I don’t know enough about WxPython to know whether that’s possible. Go ahead and try it. However, my guess is that it won’t work because the vpython module won’t know to use that browser instead of opening a new one. Maybe if you can arrange that focus be on the embedded browser it might work. But as I say, I’m not a WxPython expert.

  2. Luke says:

    Hi Bruce,

    I am following a group of lessons on “using Python with Arduino” found on the http://www.toptechboy.com website. In lesson 3, the instructor introduces us to VPython and how it can receive and interpret information coming from the serial port of the Arduino. I was able to install vpython onto my raspberry pi, but found that with the Arduino connected and the Arduino program running with VPython, the processor was running at 95%. So I installed vpython onto my Desktop computer.

    I am using Spyder version 3.3.1 to write the python script. When I create a simple program like “from vpython import*” and then “cube(), it opens a tab in my browser with the Glowscript “GS” and the page is blank. It doesn’t want to show a cube. But, I am able to see cubes and spheres if I login to the Glowscript website and upload code to it. The browser I am using is Opera 56.0.3051.52.

    I will try another browser to see if that is the problem. Would you have any advice on how I can troubleshoot this? The toptechboy website insists that the virtual python only will work with python 2.7, but I do not want to work with 2 versions of python (I like to use Python 3).

    By the way, great website and I plan on doing your tutorials if I can get the vpython working. My goal is to use it with my Arduino, like toptechboy.

    Thanks.

    • BruceSherwood says:

      I apologize that your post languished unapproved. Somehow I didn’t receive notification of your proposed post. At vpython.org see the instructions concerning installing VPython 7, where you will see that there is a problem with Spyder, which is being worked on.

  3. Tawn Kramer says:

    Do you have any examples of using a third party physics engine with VPython?

    • BruceSherwood says:

      No, I don’t, but when using GlowScript VPython you can use its get_library function to load a library written in JavaScript. If using installed Python (VPython 7) you can certainly import any Python module, which could include a physics engine. Basically, VPython doesn’t know any physics, just geometry.

  4. Pierre M says:

    Hi Bruce,
    Awesome contributions. Thank you for your efforts!
    Am using VPython 7 to view simulation results. The simulation uses numpy.
    It seems a bit awkward to be converting between numpy arrays, and vpython vectors, but I’m new to python. Perhaps there is some trick I’m missing?
    Thanks,
    Pierre

  5. BruceSherwood says:

    At the risk of telling you what you already know, I haven’t used numpy for a long time,
    so the following is surely not ideal, though it’s surely the case that numpy doesn’t
    know about the VPython vector class:

    def vectorize(data):
    vs = []
    for i in range(0,data.size,3):
    vs.append(vec(data[i], data[i+1], data[i+2]))
    return vs

    a = np.array([1,2,3,4,5,6])
    b = vectorize(a)
    print(b)

    I can say that VPython doesn’t know anything about numpy, so if you use VPython
    there is no alternative to converting between numpy and vector.

  6. BruceSherwood says:

    Ugh. Indentations were lost in leaving my response……

  7. Wow Bruce. You have my deepest respect for your creation.

    I’ve been working with vpython for the past year and i absolitley love working with it.
    This piece written here is also really interesting.

    I’ve noticed that you are a great contributor to the vpython discussion forums. I however don’t see any changes in the timeline written above since 2019. Just out of interest, why did it stop ? Was it covid ? Is there something in the pipeline ?

Leave a Reply

Your email address will not be published. Required fields are marked *