I spent quite a bit of time playing with Processing.org a few years back, mainly using it for video processing (video effects, blob detection, etc) but also for 3D. I recently stumbled across a javascript port of Processing called, logically, Processing.js. This is a really nice idea, taking the established processing syntax (a subset of Java) and rendering it to a HTML5 Canvas. The Processing framework uses a “dont call me, i’ll call you” inversion-of-control pattern which makes it very easy to get something up and running but that, and the fact that it is not standard javascript, can make it tricky to integrate.
I also found a very slick library called three.js which I used to create the header animation on rayh.com.au. It provides a basic set of 3d concepts such as points, lines, renderer, camera, etc which can use to draw and animate basic 3d scenes. There is no special loop function, you just use setInterval to trigger your animation to update every once in a while.
