function create3DContext(canvas, optAttribs) {
    var names = ['webgl', 'experimental-webgl'];
    var context = null;
    for (var ii = 0; ii < names.length; ++ii) {
        try {
            context = canvas.getContext(names[ii], optAttribs);
        } catch (e) {
            if (context) {
                break;
            }
        }
    }
    return context;
}
Creates a webgl context.
@param {!Canvas} canvas The canvas tag to get context
    from. If one is not passed in one will be created.
@return {!WebGLContext} The created context.