Simple 2D WebGL

Written by Luis Cruz on Thursday, 01 September 2011. Posted in MSCS Project

An Intro to WebGL

Simple 2D WebGL

This is my first WebGL example. Although I have some OpenGL background, I noticed many differences while coding for WebGL since it is based on OpenGL ES 2.0. This examples shows how to make WebGL calls to an HTML5 Canvas and the drawing of 3 simple geometric figures with simple fragment shading.

Since WebGL does not support some matrix operations, I am using a 3rd party library for Matrix calculations that can be found here glMatrix.js. In this first example you will also see how to setup vertex and fragment shaders, how to color, and a bit more.You will be able to see the code on your browser by going to "View Code" menu.


You need an HTML5/WebGL compatible Browser (IE does not work) Check WebGL.

Social Bookmarks

About the Author

Luis Cruz

I am pursuing my MS in Computer Science at Georgia Institute of Technology (GaTech) with emphasis in Computer Graphics. I received by BS in Computer Science at GaTech in 2009 with specialization in Software Engineering and Computer Graphics.

Leave a comment

You are commenting as guest.