GWT Augmented Reality - HOWTO - step 2

Welcome to the third (and fortunately last) step of using NyARToolkit in a GWT project.

In the previous steps (step 0 and step 1) we got NyARToolkit ready for our GWT project and we
used  the toolkit to detect a marker on a static image; now we are going use the stream from the webcam to populate the sensor.

First of all we should now really switch to GWT 2.5 and Elemental; quoting form the first post of the series:

Using Elemental in a GWT project is quite straightforward:
  1. donwload the latest GWT (well, we used for this project RC1 but all seems safe to be done with 2.5.0 final) and setup a new project;
  2. add to the build path gwt-elemental.jar (is in the unpacked gwt 2.5 archive);
  3. add to the gwt.xml file the line  <inherits name='elemental.Elemental'/>
and we are ready.


WebGL with GWT/Elemental, Going 3D

In a previous post we described how to setup a first program to use WebGL with GWT's Elemental,
library, now we will elaborate our code introducing some basic 3-D graphics.

The bad: WebGL has not support for 3D graphics.  "WebGL is a 2D library" (http://games.greggman.com/game/webgl-fundamentals/).

The good: we can provide projections operators to the graphics library and let the vertex shader(s) apply them to the data and we can, quite easily, provide a fragment shader that, using eventually values computed vertex-per-vertex by the vertex shader, will do some basic shading and lighting on  3-D objects.