I started the week by going to the guest lecture by Patric Cozzi on WebGL, and it was highly helpful. I learned about the main big ideas of WebGL, some tips and gotchas, and a handful of Javascript syntax. However, more importantly, I learned about dev tools that help such as JSLint and WebGL inspector, and I also took away names of several WebGL libraries that could be helpful.
Later in the week I started reading WebGL tutorials on learningwebgl.com.
At the same time, I also looked for libraries that I could use. I came across several:
- glMatrix.js provides fast and simple matrix class and functions
- sylvester.js offers vectors and matrices with extensive functions and flexible constructors
- Scene.js is a Javascript scene graph framework
I have decided that I would use Three.js to handle all non-rendering related work such as setting up a scene graph and moving the camera. This work will be done on the Javascript side. The heavy rendering work would be done on the shader level, which benefits from the hardware acceleration; Javascript too slow for rendering.
I have set up a simple WebGL application using Three.js. It has a basic scene graph and mouse controlled camera (click and drag on application.) The app can be found here: http://iamnop.co.cc/webgl/.
Next week I will spend my time setting up this WebGL framework so that everything is ready for rendering. Then I would move onto setting up the necessary shaders in order to do the rendering work.