May the WebGL be with you!

It is now May (really? already?), and if for some people it is the month of Star Wars, for me it is the month of WebGL.

After seeing what all the cool stuffs people are doing using WebGL (this, this and this for example), I decided to give it a go.

Basically, WebGL allows one to create OpenGL content inside a browser. The description of the page is made using usual html, and the OpenGL calls are done from javascript. Although I never really used html or javascript before,  creating a WebGL page was fairly easy, as I already knew OpenGL quite well. There is a lot of documentation on WebGL out there, but I couldn't find anything targeting WebGL development for people already accustomed with OpenGL. Most of them are simply introduction to the OpenGL world and were useless to me.  So I ended up  spending most of my time looking at javascript documentation.

Moreover, it seems there is no official documentation for javascript, as each browser has its own implementation of it. So I'm aiming for my code to run on Firefox and Chrome, and if you don't have either of them, go download them now!

If you want to develop WebGL applications, I really advice to use three.js, it's like a javascript library that will really simplify WebGL development. It basically warps all the raw OpenGL calls into a nice and easy to use framework.

Without further ado, here's the first Castle Defender WebGL editor:

The page is being hosted on one of the university server. (I hope I won't run into any trouble!)
This editor is far from finished, at for the moment you can't save your creations because I'm yet to find out how to store anything to a file using javascriipt. But here's what happens when you  give it to a girl:

Go try it now and tell me what you think!


No comments:

Post a Comment