Easy 3D animation programming in a browser, using VPython, RapydScript, CoffeeScript, or JavaScript
JavaScript GLSL Python HTML CSS Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build-tools Major new version 2.3 to use rapydscript-ng, update operator overloading Jan 5, 2017
css Forgot a file Mar 3, 2016
docs Add to Help a link to a Finnish translation of the first page Jan 12, 2017
examples button object seems complete; GlowScript.html is Vesa Lappalainen's e… Jul 25, 2016
ide Update rapydscript-ng to get fix to object == null Jan 17, 2017
lib Update rapydscript-ng to get fix to object == null Jan 17, 2017
package Update rapydscript-ng to get fix to object == null Jan 17, 2017
shaders Can again include a ring in a compound; replaced mistakenly updated R… Nov 26, 2015
static/images Setup initial state of GitHub repository, starting from the bitbucket… Dec 18, 2014
untrusted Update rapydscript-ng in-browser compiler and run-time library to fix… Jan 11, 2017
.gitignore Adds gulp for build support. Prep for bower. May 7, 2015
.project Much improved rate function; documentation improvements/corrections Dec 24, 2014
GlowScript.html Update rapydscript-ng in-browser compiler and run-time library to fix… Jan 11, 2017
LICENSE.txt Update contents of License to include information about tessellation … Jul 2, 2016
README.md Major new version 2.3 to use rapydscript-ng, update operator overloading Jan 5, 2017
app.yaml print([ [1,2], [3,4] ]) correctly (recursive);see parsearray in api_m… Sep 20, 2015
bower.json Adds gulp for build support. Prep for bower. May 7, 2015
build_cli.py [build_cli] extract glow libraries from `run.js` Jun 30, 2016
build_only_shaders.py Setup initial state of GitHub repository, starting from the bitbucket… Dec 18, 2014
build_original.py Update rapydscript-ng in-browser compiler and run-time library to fix… Jan 11, 2017
gulpfile.js Delete the old streamline files (again; they are subsumed in transfor… Dec 23, 2015
package.json Adds gulp for build support. Prep for bower. May 7, 2015

README.md

GlowScript

GlowScript makes it easy to write programs in JavaScript, RapydScript (a Python look-alike that compiles Python to JavaScript), or VPython (which uses the RapydScript compiler) that generate navigable real-time 3D animations, using the WebGL 3D graphics library available in modern browsers (with modern GPU-based graphics cards). For example, the following complete program creates a 3D canvas in the browser, displays a white 3D cube, creates default lighting, places the camera so that the cube fills the scene, and enables mouse controls to rotate and zoom the camera:

   box()

That's it. That's the whole program (except for the GlowScript version header line that is supplied automatically). The key point is that lots of sensible defaults are built into the GlowScript library. You can of course specify the canvas size, the color and other attributes of the objects, the direction of the camera view, etc.

Documentation

At glowscript.org click Help for full documentation. There is an extensive set of example programs available from the first page of glowscript.org. Programs can be created and stored at glowscript.org, but it is also possible to export a program to place on your own web page, or to use the GlowScript library without storing the program at glowscript.org. For programs stored at glowscript.org, you can share a link with someone and they can run your program simply by clicking on the link. Here is an example:

http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/Bounce-VPython

GlowScript was inspired by VPython. The project was begun in 2011 by David Scherer and Bruce Sherwood. Originally programs had to be written in JavaScript, but in November 2014 it became possible to use Python, thanks to the RapydScript Python-to-JavaScript compiler created by Alex Tsepkov. GlowScript is now using a later version, RapydScript-ng developed by Kovid Goyal.

For information related to building the GlowScript application, see MakingNewVersion.txt in the docs folder.

Sister Project

A more recent project initiated by John Coady and further developed by Ruth Chabay and Bruce Sherwood lets you run VPython programs in a Jupyter notebook: see vpython.org. The syntax is the same as GlowScript VPython, but Jupyter VPython uses an installed standard Python, which provides access to the large number of Python modules. GlowScript VPython does not require installing any software but provides access only to libraries written in JavaScript, not to standard Python modules.

Run a Local Server

This repository is a Google App Engine application. Here are instructions for running locally, using a local server:

http://www.glowscript.org/docs/GlowScriptDocs/local.html

License

The license is found at LICENSE.txt.

Early version

In December 2014 the original GlowScript repository was corrupted in such a way that it could not be reconstituted, but a backup that contains the history of commits is here:

https://bitbucket.org/davidscherer/glowscript_backup/overview