The technology in question is called WebGL and is based on the choice of HTML tags <canvas> as a basis on which to build and animate three-dimensional models derived by using the JavaScript API OpenGL ES 2.0 specifications. There are two aspects that make difficult the 3D world for someone like the author, has a background as a developer web terminology and philosophy with which they were written the API. Let's start with the latter problem, as already mentioned, the WebGL born as well as implementation of JavaScript known OPENGL ES 2.0, these APIs are low-level and intuitive operation as a sequence of commands used to control the actions of the 3D engine. An example of this approach is in the following listing WebGL that draws a single triangle on the screen:
Code:
gl.bindBuffer (gl.ARRAY_BUFFER, triangleVertexPosBuffer) gl.vertexAttributePointer (shaderProgram.vertexPosAttribute, ...); gl.uniformMatrix4fv (shaderProgram.pMatrixUniform, false, new Float32Array ...); gl.uniformMatrix4fv (shaderProgram.mvMatrixUniform, false , new Float32Array ...); gl.drawArrays (gl.TRIANGLES, 0, triangleVertexPosBuffer.numItems);
Beyond the meaning of the instructions is interesting to note that all be summed up in sending messages to the object gl ; this request identifies a framework built on a WebGL <canvas> specified using the syntax:
Code:
gl = document.getElementById ("a_canvas_id). getContext ("experimental-WebGL");
Now for the terminology is clearly not possible to list and define the glossary that covers the world linked to realtime 3D programming, but I think it is important to highlight a few concepts that will be useful shortly.
Bookmarks