JavaScript

Your browser does not support the HTML canvas tag.

JavaScript is the programming language used by web browsers. It's very different than C but the syntax is close enough that most of my graphics routines can be translated without too much trouble. After the HTML5 canvas element was created, JavaScript can be used to draw things to the canvas element in a somewhat similar way as OpenGL allows me to draw to a window. However there are some key differences between using C with OpenGL and JavaScript with Canvas.

JavaScript+Canvas runs directly in a web browser. This means that no external image files are created nor are there source files that you have to download and figure out how to compile. This makes it a LOT faster for showing cool examples on my website. But the downside is that the animations cannot be downloaded as gif files or viewed outside of a modern web browser like Google Chrome or Firefox.

C with OpenGL is a lot harder to use and requires experience with C, OpenGL, and a window toolkit like freeglut or glfw. However, it allows for the creation of things that run outside of web browsers by creating frames for animated gif or video files. Therefore there are a lot of reasons why JavaScript can never completely replace C especially if the goal is to display things directly to a window on a standard desktop operating system.

Most of the JavaScript I know was learned from this tutorial. However, the best examples of how to use it come from the canvas section of the HTML tutorial.

You can view the source code of this page with your web browser. One thing you may notice is that some of the code is in this page but some of it is in bbmlib.js. This is so that these precious functions can be used in multiple web pages when I need to.