Wednesday, September 23, 2009

WebGL and One Black Triangle

Since WebGL started getting some recent press I have been interested in giving it a try. Although I've never done anything past a hello world in either OpenGL or Javascript this seemed like a good way to do both (I taught myself raytracing and c++ in a similar, though larger in scope, mutual method a year or so back). The past week and a half has consisted of me trying to get WebGL up and running any way I could. First through Webkit by way of building from source, on Windows. Unfortunately I could not get it working. However, as I started looked for alternatives Vladimir Vukićević posted about how WebGL was now in Firefox 3.7 nightlies(you'll have to go to about:config and toggle webgl.enable_for_all_sites). After some touch and go, and with the help of his Spore example I have prevailed. 

Ladies and gentlemen, I present a black triangle

[What is a black triangle?] The linked triangle will (read: should) appear if you are using a Firefox nightly and, theoretically, if you are using a Webkit build with WebGL enabled.

NOTE: Interestingly enough, If I am not mistaken, as of 9/23/2009 I am the second person to have a Firefox WebGL demo on the internet (the first being Vlad, who put it in Firefox in the first place) I feel special :D

1 comment:

  1. Thanks! This is very helpful, as there doesn't seem to be any WebGL documentation anywhere.

    I hope you don't mind that I borrowed your triangle for my own experimentation.