Hey you! Think WebGLU isn't up to snuff? Let me know why so I can improve it!
As I’ve done work on WebGLU I’ve implemented a variety of neat features, but in doing so a couple problems have arisen. The first is that I sometimes have something semi-working, but not entirely done. The second is that some features don’t really need to be loaded into every page. The solution, for now at least, is CrazyGLU, which is where I will put any experimental, incomplete, or niche features until such time it is appropriate to relocate them to WebGLU proper.
To load CrazyGLU just call $W.useCrazyGLU() and it will be loaded in place, adding the features to the existing $W object. I don’t know if my method for dynamically loading JS files [Synchronous XMLHttpRequest for the file, then eval() the contents] is the right way to go about doing it, so speak up if there’s a better way to do it. Another upside to all this is that necessary supporting libraries, like Sylvester, now get loaded automatically, so that’s one less line you need in your page.
Speaking of Sylvester I intend to eventually replace it with a more performant library such as Vladimir Vukićević’s mjs. As Vlad mentions on his blog, Sylvester provides flexibility that isn’t necessary for a majority of graphics programming, arbitrarily sized vectors and matrices. Graphics really only require three element vectors and 4x4 matrices, and optimizing for that case speeds things up greatly.
As of today CrazyGLU includes a partially working physics simulation that powers the billiards demo. It also contains the .obj model loading code I still haven’t gotten around to fixing. The newest addition to CrazyGLU is a partial port of the C++ OpenSteer library by Craig Reynolds. OpenSteer provides a framework for giving objects ‘steering behaviors’ such as ‘stay close to others near me’ and ‘try to move towards that point’. Individually, these behaviors aren’t that big of a deal, but when you combine several behaviors in each of a few dozen objects you can get complex emergent behaviors. I will probably split OpenSteer back off into its own project at some point. In the meantime, I’ve put together a ‘Boids’ demo. Boids are ‘bird-like objects’, also developed by Craig Reynolds, that exhibit flocking behavior, but this behavior isn’t explicitly programmed. Instead, the three more simple behaviors of separation, alignment, and cohesion together allow flocking to emerge. For more information about Boids and the Java demo this one is based on, check out Craig's page on Boids. The demo below shows 40 boids doing their thing.
I will get a video of the demo up as soon as I can. If you cannot see the demo please check the WebGL wiki for how to get a web browser that supports WebGL